##// END OF EJS Templates
rust: use `matches!` macro now that we're using Rust 1.42+
Raphaël Gomès -
r50528:ec399ddf default
parent child Browse files
Show More
@@ -198,8 +198,9 b" impl<'a> Escaped for &'a HgPath {"
198 198
199 199 #[cfg(unix)]
200 200 pub fn shell_quote(value: &[u8]) -> Vec<u8> {
201 // TODO: Use the `matches!` macro when we require Rust 1.42+
202 if value.iter().all(|&byte| match byte {
201 if value.iter().all(|&byte| {
202 matches!(
203 byte,
203 204 b'a'..=b'z'
204 205 | b'A'..=b'Z'
205 206 | b'0'..=b'9'
@@ -207,8 +208,8 b' pub fn shell_quote(value: &[u8]) -> Vec<'
207 208 | b'_'
208 209 | b'/'
209 210 | b'+'
210 | b'-' => true,
211 _ => false,
211 | b'-'
212 )
212 213 }) {
213 214 value.to_owned()
214 215 } else {
General Comments 0
You need to be logged in to leave comments. Login now