From acb1231e40224d469df400ed8b88d325e14772f8 Mon Sep 17 00:00:00 2001 From: Martin Nordholts Date: Wed, 8 Dec 2021 08:29:10 +0100 Subject: [PATCH] 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. --- src/bin/bat/config.rs | 2 +- src/input.rs | 2 +- 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, 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, 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, })