Show More
@@ -198,17 +198,18 impl<'a> Escaped for &'a HgPath { | |||||
198 |
|
198 | |||
199 | #[cfg(unix)] |
|
199 | #[cfg(unix)] | |
200 | pub fn shell_quote(value: &[u8]) -> Vec<u8> { |
|
200 | pub fn shell_quote(value: &[u8]) -> Vec<u8> { | |
201 | // TODO: Use the `matches!` macro when we require Rust 1.42+ |
|
201 | if value.iter().all(|&byte| { | |
202 | if value.iter().all(|&byte| match byte { |
|
202 | matches!( | |
203 | b'a'..=b'z' |
|
203 | byte, | |
204 |
|
|
204 | b'a'..=b'z' | |
205 |
| b' |
|
205 | | b'A'..=b'Z' | |
206 | | b'.' |
|
206 | | b'0'..=b'9' | |
207 |
| b' |
|
207 | | b'.' | |
208 |
| b' |
|
208 | | b'_' | |
209 |
| b' |
|
209 | | b'/' | |
210 |
| b' |
|
210 | | b'+' | |
211 | _ => false, |
|
211 | | b'-' | |
|
212 | ) | |||
212 | }) { |
|
213 | }) { | |
213 | value.to_owned() |
|
214 | value.to_owned() | |
214 | } else { |
|
215 | } else { |
General Comments 0
You need to be logged in to leave comments.
Login now