summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Nordholts <enselic@gmail.com>2021-12-08 08:29:10 +0100
committerMartin Nordholts <enselic@gmail.com>2022-05-04 07:49:40 +0200
commitacb1231e40224d469df400ed8b88d325e14772f8 (patch)
treed71ce33e982f256dfdb7ef96b27cc9b84e9ee2b1
parent3ae05333b0ee7bfe45e706232e8d15888d65211e (diff)
Run `cargo clippy --fix --all-targets --all-features` with Rust 1.60
Clippy in the newly released Rust 1.60 found some new lints. Conveniently, all of them were fixable with `--fix`. By fixing these lints it becomes easier for us and others to see when new lints are introduced.
-rw-r--r--src/bin/bat/config.rs2
-rw-r--r--src/input.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/bin/bat/config.rs b/src/bin/bat/config.rs
index 659f67b3..4b4e8ff2 100644
--- a/src/bin/bat/config.rs
+++ b/src/bin/bat/config.rs
@@ -91,7 +91,7 @@ pub fn get_args_from_config_file() -> Result<Vec<OsString>, shell_words::ParseEr
.ok()
.map(|content| get_args_from_str(&content))
.transpose()?
- .unwrap_or_else(Vec::new))
+ .unwrap_or_default())
}
pub fn get_args_from_env_var() -> Option<Result<Vec<OsString>, shell_words::ParseError>> {
diff --git a/src/input.rs b/src/input.rs
index 3c295822..23e21506 100644
--- a/src/input.rs
+++ b/src/input.rs
@@ -118,7 +118,7 @@ impl OpenedInput<'_> {
self.metadata
.user_provided_name
.as_ref()
- .or_else(|| match self.kind {
+ .or(match self.kind {
OpenedInputKind::OrdinaryFile(ref path) => Some(path),
_ => None,
})