# HG changeset patch # User Raphaël Gomès # Date 2022-11-14 14:34:51 # Node ID ec399ddf6764c13303ae3f706b68fce7d7ae61b9 # Parent 048f829a445ab655835aba3d197adb7d2e60a27f rust: use `matches!` macro now that we're using Rust 1.42+ diff --git a/rust/hg-core/src/utils.rs b/rust/hg-core/src/utils.rs --- a/rust/hg-core/src/utils.rs +++ b/rust/hg-core/src/utils.rs @@ -198,17 +198,18 @@ impl<'a> Escaped for &'a HgPath { #[cfg(unix)] pub fn shell_quote(value: &[u8]) -> Vec { - // TODO: Use the `matches!` macro when we require Rust 1.42+ - if value.iter().all(|&byte| match byte { - b'a'..=b'z' - | b'A'..=b'Z' - | b'0'..=b'9' - | b'.' - | b'_' - | b'/' - | b'+' - | b'-' => true, - _ => false, + if value.iter().all(|&byte| { + matches!( + byte, + b'a'..=b'z' + | b'A'..=b'Z' + | b'0'..=b'9' + | b'.' + | b'_' + | b'/' + | b'+' + | b'-' + ) }) { value.to_owned() } else {