on master help sign in
Run `cargo clippy --fix --all-targets --all-features` with Rust 1.57

Clippy in the newly released Rust 1.57 found some new lints. Conveniently, all of them were fixable with `--fix`.

commite250da8aaa6fc8e09b3c7881838d22843ef3fcda authorMartin Nordholts <enselic@gmail.com> dateWed 8 Dec 2021, 08:29 (5 years ago) parent7fceb48
3 files changed+3−3
src/assets.rs+1−1 src/bin/bat/app.rs+1−1 src/bin/bat/config.rs+1−1
src/assets.rs+1−1
@@ -195,7 +195,7 @@ impl HighlightingAssets {
195195 bat_warning!("Unknown theme '{}', using default.", theme)
196196 }
197197 self.get_theme_set()
198− .get(self.fallback_theme.unwrap_or_else(|| Self::default_theme()))
198+ .get(self.fallback_theme.unwrap_or_else(Self::default_theme))
199199 .expect("something is very wrong if the default theme is missing")
200200 }
201201 }
src/bin/bat/app.rs+1−1
@@ -307,7 +307,7 @@ impl App {
307307 .map(|style_str| {
308308 style_str
309309 .split(',')
310− .map(|x| StyleComponent::from_str(x))
310+ .map(StyleComponent::from_str)
311311 .collect::<Result<Vec<StyleComponent>>>()
312312 })
313313 .transpose()?;
src/bin/bat/config.rs+1−1
@@ -104,7 +104,7 @@ fn get_args_from_str(content: &str) -> Result<Vec<OsString>, shell_words::ParseE
104104 .map(|line| line.trim())
105105 .filter(|line| !line.is_empty())
106106 .filter(|line| !line.starts_with('#'))
107− .map(|line| shell_words::split(line))
107+ .map(shell_words::split)
108108 .collect::<Result<Vec<_>, _>>()?;
109109
110110 Ok(args_per_line