Show More
@@ -198,8 +198,9 b" 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 | byte, | |||
203 | b'a'..=b'z' |
|
204 | b'a'..=b'z' | |
204 | | b'A'..=b'Z' |
|
205 | | b'A'..=b'Z' | |
205 | | b'0'..=b'9' |
|
206 | | b'0'..=b'9' | |
@@ -207,8 +208,8 b' pub fn shell_quote(value: &[u8]) -> Vec<' | |||||
207 | | b'_' |
|
208 | | b'_' | |
208 | | b'/' |
|
209 | | b'/' | |
209 | | b'+' |
|
210 | | b'+' | |
210 |
| b'-' |
|
211 | | b'-' | |
211 | _ => false, |
|
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