From e227fae326b4c411608bbec3c218220627a8a06b Mon Sep 17 00:00:00 2001 From: Federico Terzi Date: Wed, 6 Oct 2021 18:39:42 +0200 Subject: [PATCH] style(migrate): fix formatting --- espanso-migrate/src/convert.rs | 68 ++++++++++++++++++++++++++-------- espanso-migrate/src/render.rs | 6 ++- 2 files changed, 57 insertions(+), 17 deletions(-) diff --git a/espanso-migrate/src/convert.rs b/espanso-migrate/src/convert.rs index 0368b6d..9fd8613 100644 --- a/espanso-migrate/src/convert.rs +++ b/espanso-migrate/src/convert.rs @@ -42,7 +42,9 @@ pub fn convert(input_files: HashMap) -> HashMap) -> HashMap) -> HashMap) -> HashMap Some(Yaml::String("CTRL+V".to_string())), - Yaml::String(shortcut) if shortcut == "CtrlShiftV" => Some(Yaml::String("CTRL+SHIFT+V".to_string())), - Yaml::String(shortcut) if shortcut == "ShiftInsert" => Some(Yaml::String("SHIFT+INSERT".to_string())), - Yaml::String(shortcut) if shortcut == "CtrlAltV" => Some(Yaml::String("CTRL+ALT+V".to_string())), + Yaml::String(shortcut) if shortcut == "CtrlShiftV" => { + Some(Yaml::String("CTRL+SHIFT+V".to_string())) + } + Yaml::String(shortcut) if shortcut == "ShiftInsert" => { + Some(Yaml::String("SHIFT+INSERT".to_string())) + } + Yaml::String(shortcut) if shortcut == "CtrlAltV" => { + Some(Yaml::String("CTRL+ALT+V".to_string())) + } Yaml::String(shortcut) if shortcut == "MetaV" => Some(Yaml::String("META+V".to_string())), Yaml::String(_) => None, _ => None, @@ -136,10 +146,20 @@ pub fn convert(input_files: HashMap) -> HashMap) -> HashMap) -> HashMap Result { let lines: Vec<&str> = dump_str.lines().collect(); let header = format!("# Original file: {}", file.origin); - let mut output_lines: Vec<&str> = vec!["# Automatically generated by espanso migration tool", &header, ""]; + let mut output_lines: Vec<&str> = vec![ + "# Automatically generated by espanso migration tool", + &header, + "", + ]; if !lines.is_empty() { output_lines.extend(&lines[1..]); }