mirror of
https://github.com/Llewellynvdm/starship.git
synced 2024-12-01 01:04:00 +00: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 {
|
pub fn get_configuration(context: &Context) -> toml::Table {
|
||||||
let starship_config = StarshipConfig::initialize(&context.get_config_path_os());
|
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 {
|
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_specified = Some(format!("{} ", Color::Green.bold().paint("V")));
|
||||||
let expected_visual = Some(format!("{} ", Color::Yellow.bold().paint("❮")));
|
let expected_visual = Some(format!("{} ", Color::Yellow.bold().paint("❮")));
|
||||||
let expected_replace = Some(format!("{} ", Color::Purple.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("❯")));
|
let expected_other = Some(format!("{} ", Color::Green.bold().paint("❯")));
|
||||||
|
|
||||||
// fish keymap is default
|
// fish keymap is default
|
||||||
@ -219,7 +219,7 @@ mod test {
|
|||||||
.shell(Shell::Fish)
|
.shell(Shell::Fish)
|
||||||
.keymap("replace_one")
|
.keymap("replace_one")
|
||||||
.collect();
|
.collect();
|
||||||
assert_eq!(expected_replace_one, actual);
|
assert_eq!(expected_replace_one, actual.as_deref());
|
||||||
|
|
||||||
// fish keymap is other
|
// fish keymap is other
|
||||||
let actual = ModuleRenderer::new("character")
|
let actual = ModuleRenderer::new("character")
|
||||||
|
@ -83,7 +83,7 @@ mod tests {
|
|||||||
|
|
||||||
macro_rules! get_hostname {
|
macro_rules! get_hostname {
|
||||||
() => {
|
() => {
|
||||||
if let Some(hostname) = gethostname::gethostname().into_string().ok() {
|
if let Ok(hostname) = gethostname::gethostname().into_string() {
|
||||||
hostname
|
hostname
|
||||||
} else {
|
} else {
|
||||||
println!(
|
println!(
|
||||||
|
@ -226,7 +226,7 @@ mod tests {
|
|||||||
"3.12.0",
|
"3.12.0",
|
||||||
];
|
];
|
||||||
|
|
||||||
for input in inputs.iter() {
|
for input in &inputs {
|
||||||
assert_eq!(parse_version(input), expected);
|
assert_eq!(parse_version(input), expected);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -243,7 +243,7 @@ mod tests {
|
|||||||
"3.12.0-alpha",
|
"3.12.0-alpha",
|
||||||
];
|
];
|
||||||
|
|
||||||
for input in inputs.iter() {
|
for input in &inputs {
|
||||||
assert_eq!(parse_version(input), expected);
|
assert_eq!(parse_version(input), expected);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -260,7 +260,7 @@ mod tests {
|
|||||||
"3.12.0-alpha.1630554544+f89e9a29.dirty",
|
"3.12.0-alpha.1630554544+f89e9a29.dirty",
|
||||||
];
|
];
|
||||||
|
|
||||||
for input in inputs.iter() {
|
for input in &inputs {
|
||||||
assert_eq!(parse_version(input), expected);
|
assert_eq!(parse_version(input), expected);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user