diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 08b9c702..bcdf2ad3 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -14,7 +14,7 @@ repository = "https://github.com/watchexec/watchexec" readme = "README.md" rust-version = "1.56.0" -edition = "2018" +edition = "2021" [[bin]] name = "watchexec" diff --git a/lib/Cargo.toml b/lib/Cargo.toml index 0c5952ca..b460c7f8 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -13,7 +13,7 @@ repository = "https://github.com/watchexec/watchexec" readme = "README.md" rust-version = "1.56.0" -edition = "2018" +edition = "2021" [dependencies] async-recursion = "0.3.2" diff --git a/lib/src/project.rs b/lib/src/project.rs index c8a17086..c6e48369 100644 --- a/lib/src/project.rs +++ b/lib/src/project.rs @@ -119,7 +119,7 @@ pub async fn origins(path: impl AsRef) -> HashSet { return false; } - IntoIterator::into_iter([ + [ list.has_dir("_darcs"), list.has_dir(".bzr"), list.has_dir(".fossil-settings"), @@ -165,7 +165,8 @@ pub async fn origins(path: impl AsRef) -> HashSet { list.has_file("README"), list.has_file("requirements.txt"), list.has_file("v.mod"), - ]) + ] + .into_iter() .any(|f| f) } @@ -196,7 +197,7 @@ pub async fn origins(path: impl AsRef) -> HashSet { /// anything for some paths returned by [`origins()`]. pub async fn types(path: impl AsRef) -> HashSet { let list = DirList::obtain(path.as_ref()).await; - IntoIterator::into_iter([ + [ list.if_has_dir("_darcs", ProjectType::Darcs), list.if_has_dir(".bzr", ProjectType::Bazaar), list.if_has_dir(".fossil-settings", ProjectType::Fossil), @@ -222,7 +223,8 @@ pub async fn types(path: impl AsRef) -> HashSet { list.if_has_file("project.clj", ProjectType::Leiningen), list.if_has_file("requirements.txt", ProjectType::Pip), list.if_has_file("v.mod", ProjectType::V), - ]) + ] + .into_iter() .flatten() .collect() } diff --git a/lib/src/signal/process.rs b/lib/src/signal/process.rs index 632d49fa..f1843701 100644 --- a/lib/src/signal/process.rs +++ b/lib/src/signal/process.rs @@ -115,8 +115,6 @@ impl SubSignal { /// [`Custom`][SubSignal::Custom], as the first-class ones are always supported). #[cfg(unix)] pub fn to_nix(self) -> Option { - use std::convert::TryFrom; - match self { Self::Hangup => Some(NixSignal::SIGHUP), Self::ForceStop => Some(NixSignal::SIGKILL), @@ -181,8 +179,6 @@ impl FromStr for SubSignal { #[cfg(unix)] fn from_str(s: &str) -> Result { - use std::convert::TryFrom; - if let Ok(sig) = i32::from_str(s) { if let Ok(sig) = NixSignal::try_from(sig) { return Ok(Self::from_nix(sig));