diff --git a/src/lib.rs b/src/lib.rs index db4376d..f295950 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -46,7 +46,13 @@ impl fmt::Display for HostnameGroup { } else { "" }; - write!(f, "{}{}\n{}\n", self.name, disabled, padded_hostnames.join("\n")) + write!( + f, + "{}{}\n{}\n", + self.name, + disabled, + padded_hostnames.join("\n") + ) } } @@ -182,7 +188,5 @@ pub fn overwrite_config_file(hostgroups: &HostnameGroups) -> Result<(), Box Vec { - args.split(',') - .map(|x| x.to_lowercase()) - .collect() + args.split(',').map(|x| x.to_lowercase()).collect() } diff --git a/src/main.rs b/src/main.rs index 965c592..c8f0fda 100644 --- a/src/main.rs +++ b/src/main.rs @@ -86,7 +86,11 @@ fn main() { for group in groups.iter_mut() { if group.name.to_lowercase() == toggle_group.to_lowercase() { group.disabled = Some(!group.disabled.unwrap_or(false)); - println!("Toggled group: {}. Disabled: {}", group.name, group.disabled.unwrap_or(false)); + println!( + "Toggled group: {}. Disabled: {}", + group.name, + group.disabled.unwrap_or(false) + ); } } } @@ -106,10 +110,7 @@ fn main() { if !args.group.is_empty() && !args.add.is_empty() { match read_hostname_groups_config() { Ok(mut groups) => { - let new_hostnames = split_args( - &args.add - .trim() - ) + let new_hostnames = split_args(args.add.trim()) .into_iter() // .replace(' ', "") .filter(|hostname| hostname.contains('.'))