diff --git a/src/configure.rs b/src/configure.rs index 505548999..ec23cf799 100644 --- a/src/configure.rs +++ b/src/configure.rs @@ -219,7 +219,7 @@ fn handle_toggle_configuration(doc: &mut Document, name: &str, key: &str) -> Res pub fn get_configuration(context: &Context) -> toml::Table { let starship_config = StarshipConfig::initialize(&context.get_config_path_os()); - starship_config.config.unwrap_or(toml::Table::new()) + starship_config.config.unwrap_or_default() } pub fn get_configuration_edit(context: &Context) -> Document { diff --git a/src/modules/character.rs b/src/modules/character.rs index c897b4260..20695f63a 100644 --- a/src/modules/character.rs +++ b/src/modules/character.rs @@ -179,7 +179,7 @@ mod test { let expected_specified = Some(format!("{} ", Color::Green.bold().paint("V"))); let expected_visual = Some(format!("{} ", Color::Yellow.bold().paint("❮"))); let expected_replace = Some(format!("{} ", Color::Purple.bold().paint("❮"))); - let expected_replace_one = expected_replace.clone(); + let expected_replace_one = expected_replace.as_deref(); let expected_other = Some(format!("{} ", Color::Green.bold().paint("❯"))); // fish keymap is default @@ -219,7 +219,7 @@ mod test { .shell(Shell::Fish) .keymap("replace_one") .collect(); - assert_eq!(expected_replace_one, actual); + assert_eq!(expected_replace_one, actual.as_deref()); // fish keymap is other let actual = ModuleRenderer::new("character") diff --git a/src/modules/hostname.rs b/src/modules/hostname.rs index 004cb7a55..d476dcf44 100644 --- a/src/modules/hostname.rs +++ b/src/modules/hostname.rs @@ -83,7 +83,7 @@ mod tests { macro_rules! get_hostname { () => { - if let Some(hostname) = gethostname::gethostname().into_string().ok() { + if let Ok(hostname) = gethostname::gethostname().into_string() { hostname } else { println!( diff --git a/src/modules/pulumi.rs b/src/modules/pulumi.rs index 65a89b2a8..093014492 100644 --- a/src/modules/pulumi.rs +++ b/src/modules/pulumi.rs @@ -226,7 +226,7 @@ mod tests { "3.12.0", ]; - for input in inputs.iter() { + for input in &inputs { assert_eq!(parse_version(input), expected); } } @@ -243,7 +243,7 @@ mod tests { "3.12.0-alpha", ]; - for input in inputs.iter() { + for input in &inputs { assert_eq!(parse_version(input), expected); } } @@ -260,7 +260,7 @@ mod tests { "3.12.0-alpha.1630554544+f89e9a29.dirty", ]; - for input in inputs.iter() { + for input in &inputs { assert_eq!(parse_version(input), expected); } }