mirror of
https://github.com/starship/starship.git
synced 2024-11-23 00:33:16 +01:00
chore: fix new clippy lints (#5241)
This commit is contained in:
parent
847a642d6a
commit
796a582f3c
@ -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 {
|
||||
|
@ -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")
|
||||
|
@ -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!(
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user