From bb97db3918f6313f1bfda4c22c4ba8c1754230b8 Mon Sep 17 00:00:00 2001 From: r-vdp Date: Thu, 23 Apr 2026 09:26:51 +0200 Subject: [PATCH] switch-to-configuration-ng: rustfmt --- .../sw/switch-to-configuration-ng/src/main.rs | 25 ++++++++----------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/pkgs/by-name/sw/switch-to-configuration-ng/src/main.rs b/pkgs/by-name/sw/switch-to-configuration-ng/src/main.rs index aa0d6e6b6012..348f7cae5d65 100644 --- a/pkgs/by-name/sw/switch-to-configuration-ng/src/main.rs +++ b/pkgs/by-name/sw/switch-to-configuration-ng/src/main.rs @@ -604,8 +604,10 @@ fn compare_units(current_unit: &UnitInfo, new_unit: &UnitInfo) -> UnitComparison return UnitComparison::UnequalNeedsRestart; } } - } else if section_name == "Exec" && ini_cmp.len() == 1 - && ini_cmp.contains_key("ExecReload") { + } else if section_name == "Exec" + && ini_cmp.len() == 1 + && ini_cmp.contains_key("ExecReload") + { ret = UnitComparison::UnequalNeedsReload; continue; } else { @@ -616,7 +618,9 @@ fn compare_units(current_unit: &UnitInfo, new_unit: &UnitInfo) -> UnitComparison // A section was introduced that was missing in the previous unit if !section_cmp.is_empty() { - if section_cmp.keys().len() == 1 && (section_cmp.contains_key("Unit") || section_cmp.contains_key("Service")) { + if section_cmp.keys().len() == 1 + && (section_cmp.contains_key("Unit") || section_cmp.contains_key("Service")) + { if let Some(new_unit_unit) = new_unit.get("Unit") { for ini_key in new_unit_unit.keys() { if !unit_section_ignores.contains_key(ini_key.as_str()) { @@ -2646,10 +2650,7 @@ invalid &HashMap::from([]), &HashMap::from([( "Service".to_string(), - HashMap::from([( - "ExecReload".to_string(), - vec!["foobar".to_string()] - )]) + HashMap::from([("ExecReload".to_string(), vec!["foobar".to_string()])]) )]) ) == super::UnitComparison::UnequalNeedsReload ); @@ -2658,17 +2659,11 @@ invalid super::compare_units( &HashMap::from([( "Service".to_string(), - HashMap::from([( - "ExecReload".to_string(), - vec!["foobar".to_string()] - )]) + HashMap::from([("ExecReload".to_string(), vec!["foobar".to_string()])]) )]), &HashMap::from([( "Service".to_string(), - HashMap::from([( - "ExecReload".to_string(), - vec!["barfoo".to_string()] - )]) + HashMap::from([("ExecReload".to_string(), vec!["barfoo".to_string()])]) )]) ) == super::UnitComparison::UnequalNeedsReload );