##// 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,17 +198,18 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 {
203 b'a'..=b'z'
204 | b'A'..=b'Z'
205 | b'0'..=b'9'
206 | b'.'
207 | b'_'
208 | b'/'
209 | b'+'
210 | b'-' => true,
211 _ => false,
201 if value.iter().all(|&byte| {
202 matches!(
203 byte,
204 b'a'..=b'z'
205 | b'A'..=b'Z'
206 | b'0'..=b'9'
207 | b'.'
208 | b'_'
209 | b'/'
210 | b'+'
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