refactor: Trim whitespace from end of each line in table output
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
This commit is contained in:
@@ -140,6 +140,14 @@ pub fn settings_output_format(settings: &config::Settings) -> OutputFormat {
|
||||
.unwrap_or(OutputFormat::Table)
|
||||
}
|
||||
|
||||
/// Trim whitespace from the end of each line in a string
|
||||
pub fn trim_lines_end(s: &str) -> String {
|
||||
s.lines()
|
||||
.map(|line| line.trim_end())
|
||||
.collect::<Vec<&str>>()
|
||||
.join("\n")
|
||||
}
|
||||
|
||||
/// Create a table with consistent styling and terminal detection
|
||||
pub fn create_table(use_styling: bool) -> Table {
|
||||
let mut table = Table::new();
|
||||
|
||||
Reference in New Issue
Block a user