mirror of
https://github.com/watchexec/watchexec.git
synced 2024-11-16 00:58:31 +01:00
Opt in to 2021 ed
This commit is contained in:
parent
be37349b90
commit
401437784d
4 changed files with 8 additions and 10 deletions
|
@ -14,7 +14,7 @@ repository = "https://github.com/watchexec/watchexec"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
|
|
||||||
rust-version = "1.56.0"
|
rust-version = "1.56.0"
|
||||||
edition = "2018"
|
edition = "2021"
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "watchexec"
|
name = "watchexec"
|
||||||
|
|
|
@ -13,7 +13,7 @@ repository = "https://github.com/watchexec/watchexec"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
|
|
||||||
rust-version = "1.56.0"
|
rust-version = "1.56.0"
|
||||||
edition = "2018"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
async-recursion = "0.3.2"
|
async-recursion = "0.3.2"
|
||||||
|
|
|
@ -119,7 +119,7 @@ pub async fn origins(path: impl AsRef<Path>) -> HashSet<PathBuf> {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
IntoIterator::into_iter([
|
[
|
||||||
list.has_dir("_darcs"),
|
list.has_dir("_darcs"),
|
||||||
list.has_dir(".bzr"),
|
list.has_dir(".bzr"),
|
||||||
list.has_dir(".fossil-settings"),
|
list.has_dir(".fossil-settings"),
|
||||||
|
@ -165,7 +165,8 @@ pub async fn origins(path: impl AsRef<Path>) -> HashSet<PathBuf> {
|
||||||
list.has_file("README"),
|
list.has_file("README"),
|
||||||
list.has_file("requirements.txt"),
|
list.has_file("requirements.txt"),
|
||||||
list.has_file("v.mod"),
|
list.has_file("v.mod"),
|
||||||
])
|
]
|
||||||
|
.into_iter()
|
||||||
.any(|f| f)
|
.any(|f| f)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -196,7 +197,7 @@ pub async fn origins(path: impl AsRef<Path>) -> HashSet<PathBuf> {
|
||||||
/// anything for some paths returned by [`origins()`].
|
/// anything for some paths returned by [`origins()`].
|
||||||
pub async fn types(path: impl AsRef<Path>) -> HashSet<ProjectType> {
|
pub async fn types(path: impl AsRef<Path>) -> HashSet<ProjectType> {
|
||||||
let list = DirList::obtain(path.as_ref()).await;
|
let list = DirList::obtain(path.as_ref()).await;
|
||||||
IntoIterator::into_iter([
|
[
|
||||||
list.if_has_dir("_darcs", ProjectType::Darcs),
|
list.if_has_dir("_darcs", ProjectType::Darcs),
|
||||||
list.if_has_dir(".bzr", ProjectType::Bazaar),
|
list.if_has_dir(".bzr", ProjectType::Bazaar),
|
||||||
list.if_has_dir(".fossil-settings", ProjectType::Fossil),
|
list.if_has_dir(".fossil-settings", ProjectType::Fossil),
|
||||||
|
@ -222,7 +223,8 @@ pub async fn types(path: impl AsRef<Path>) -> HashSet<ProjectType> {
|
||||||
list.if_has_file("project.clj", ProjectType::Leiningen),
|
list.if_has_file("project.clj", ProjectType::Leiningen),
|
||||||
list.if_has_file("requirements.txt", ProjectType::Pip),
|
list.if_has_file("requirements.txt", ProjectType::Pip),
|
||||||
list.if_has_file("v.mod", ProjectType::V),
|
list.if_has_file("v.mod", ProjectType::V),
|
||||||
])
|
]
|
||||||
|
.into_iter()
|
||||||
.flatten()
|
.flatten()
|
||||||
.collect()
|
.collect()
|
||||||
}
|
}
|
||||||
|
|
|
@ -115,8 +115,6 @@ impl SubSignal {
|
||||||
/// [`Custom`][SubSignal::Custom], as the first-class ones are always supported).
|
/// [`Custom`][SubSignal::Custom], as the first-class ones are always supported).
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
pub fn to_nix(self) -> Option<NixSignal> {
|
pub fn to_nix(self) -> Option<NixSignal> {
|
||||||
use std::convert::TryFrom;
|
|
||||||
|
|
||||||
match self {
|
match self {
|
||||||
Self::Hangup => Some(NixSignal::SIGHUP),
|
Self::Hangup => Some(NixSignal::SIGHUP),
|
||||||
Self::ForceStop => Some(NixSignal::SIGKILL),
|
Self::ForceStop => Some(NixSignal::SIGKILL),
|
||||||
|
@ -181,8 +179,6 @@ impl FromStr for SubSignal {
|
||||||
|
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||||
use std::convert::TryFrom;
|
|
||||||
|
|
||||||
if let Ok(sig) = i32::from_str(s) {
|
if let Ok(sig) = i32::from_str(s) {
|
||||||
if let Ok(sig) = NixSignal::try_from(sig) {
|
if let Ok(sig) = NixSignal::try_from(sig) {
|
||||||
return Ok(Self::from_nix(sig));
|
return Ok(Self::from_nix(sig));
|
||||||
|
|
Loading…
Reference in a new issue