fix: Ensure all match arms return the same type in table style setting

Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
This commit is contained in:
Andrew Phillips
2025-09-08 19:08:37 -03:00
parent a8542d7dee
commit bb45af93fc

View File

@@ -184,10 +184,18 @@ pub fn create_table_with_config(table_config: &crate::config::TableConfig) -> Ta
// Set style preset // Set style preset
match &table_config.style { match &table_config.style {
crate::config::TableStyle::Ascii => table.load_preset(comfy_table::presets::ASCII_FULL), crate::config::TableStyle::Ascii => {
crate::config::TableStyle::Utf8 => table.load_preset(comfy_table::presets::UTF8_FULL), table.load_preset(comfy_table::presets::ASCII_FULL);
crate::config::TableStyle::Utf8Full => table.load_preset(comfy_table::presets::UTF8_FULL), }
crate::config::TableStyle::Nothing => table.load_preset(comfy_table::presets::NOTHING), crate::config::TableStyle::Utf8 => {
table.load_preset(comfy_table::presets::UTF8_FULL);
}
crate::config::TableStyle::Utf8Full => {
table.load_preset(comfy_table::presets::UTF8_FULL);
}
crate::config::TableStyle::Nothing => {
table.load_preset(comfy_table::presets::NOTHING);
}
crate::config::TableStyle::Custom(preset) => { crate::config::TableStyle::Custom(preset) => {
// For custom presets, we'd need to parse the string // For custom presets, we'd need to parse the string
// This is a placeholder for custom preset handling // This is a placeholder for custom preset handling
@@ -200,7 +208,7 @@ pub fn create_table_with_config(table_config: &crate::config::TableConfig) -> Ta
} }
// Add more presets as needed // Add more presets as needed
} }
} };
// Apply modifiers // Apply modifiers
for modifier in &table_config.modifiers { for modifier in &table_config.modifiers {