File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -13,10 +13,7 @@ use std::{
13
13
14
14
15
15
fn whitelisted ( byte : u8 ) -> bool {
16
- match byte {
17
- b'a' ..=b'z' | b'A' ..=b'Z' | b'0' ..=b'9' | b'-' | b'_' | b'=' | b'/' | b',' | b'.' | b'+' => true ,
18
- _ => false ,
19
- }
16
+ matches ! ( byte, b'a' ..=b'z' | b'A' ..=b'Z' | b'0' ..=b'9' | b'-' | b'_' | b'=' | b'/' | b',' | b'.' | b'+' )
20
17
}
21
18
22
19
/// Escape characters that may have special meaning in a shell, including spaces.
@@ -27,7 +24,7 @@ fn whitelisted(byte: u8) -> bool {
27
24
///
28
25
/// [`shell-escape::unix::escape`]: https://docs.rs/shell-escape/latest/src/shell_escape/lib.rs.html#101
29
26
///
30
- pub fn escape ( s : & OsStr ) -> Cow < ' _ , OsStr > {
27
+ pub ( crate ) fn escape ( s : & OsStr ) -> Cow < ' _ , OsStr > {
31
28
let as_bytes = s. as_bytes ( ) ;
32
29
let all_whitelisted = as_bytes. iter ( ) . copied ( ) . all ( whitelisted) ;
33
30
You can’t perform that action at this time.
0 commit comments