From 009ef2356fc59137d656f11ecc4e46b6fd32364b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Wed, 13 Apr 2022 22:59:43 +1200 Subject: [PATCH] Deny 2018 idioms --- cli/src/main.rs | 2 ++ lib/src/ignore/files.rs | 4 ++-- lib/src/lib.rs | 1 + lib/src/swaplock.rs | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cli/src/main.rs b/cli/src/main.rs index ef26c65..c3cd15e 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -1,3 +1,5 @@ +#![deny(rust_2018_idioms)] + use std::env::var; use miette::{IntoDiagnostic, Result}; diff --git a/lib/src/ignore/files.rs b/lib/src/ignore/files.rs index 8db1e97..92682af 100644 --- a/lib/src/ignore/files.rs +++ b/lib/src/ignore/files.rs @@ -69,7 +69,7 @@ pub async fn from_origin(path: impl AsRef) -> (Vec, Vec Ok(Some(path)) => match GitConfig::open(&path) { Err(err) => errors.push(Error::new(ErrorKind::Other, err)), Ok(config) => { - if let Ok(excludes) = config.value::("core", None, "excludesFile") { + if let Ok(excludes) = config.value::>("core", None, "excludesFile") { match excludes.interpolate(None) { Ok(e) => { discover_file( @@ -209,7 +209,7 @@ pub async fn from_environment() -> (Vec, Vec) { match GitConfig::from_env_paths(&options) { Err(err) => errors.push(Error::new(ErrorKind::Other, err)), Ok(config) => { - if let Ok(excludes) = config.value::("core", None, "excludesFile") { + if let Ok(excludes) = config.value::>("core", None, "excludesFile") { match excludes.interpolate(None) { Ok(e) => { if discover_file( diff --git a/lib/src/lib.rs b/lib/src/lib.rs index 73c271c..db3e079 100644 --- a/lib/src/lib.rs +++ b/lib/src/lib.rs @@ -94,6 +94,7 @@ #![doc(html_favicon_url = "https://watchexec.github.io/logo:watchexec.svg")] #![doc(html_logo_url = "https://watchexec.github.io/logo:watchexec.svg")] #![warn(clippy::unwrap_used, missing_docs)] +#![deny(rust_2018_idioms)] #![cfg_attr(not(target_os = "fuchsia"), forbid(unsafe_code))] // see event::ProcessEnd for why this is disabled on fuchsia diff --git a/lib/src/swaplock.rs b/lib/src/swaplock.rs index 419d240..8adac84 100644 --- a/lib/src/swaplock.rs +++ b/lib/src/swaplock.rs @@ -50,7 +50,7 @@ impl fmt::Debug for SwapLock where T: fmt::Debug + Clone, { - fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> { f.debug_struct("SwapLock") .field("(watch)", &self.r) .finish()