Skip to content

Commit 3673202

Browse files
Run cargo clippy --fix and persist all modifications to escape.rs
Signed-off-by: Aalekh Patel <aalekh@protectchildren.ca>
1 parent 32bfcbc commit 3673202

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/escape.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@ use std::{
1313

1414

1515
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'+')
2017
}
2118

2219
/// Escape characters that may have special meaning in a shell, including spaces.
@@ -27,7 +24,7 @@ fn whitelisted(byte: u8) -> bool {
2724
///
2825
/// [`shell-escape::unix::escape`]: https://docs.rs/shell-escape/latest/src/shell_escape/lib.rs.html#101
2926
///
30-
pub fn escape(s: &OsStr) -> Cow<'_, OsStr> {
27+
pub(crate) fn escape(s: &OsStr) -> Cow<'_, OsStr> {
3128
let as_bytes = s.as_bytes();
3229
let all_whitelisted = as_bytes.iter().copied().all(whitelisted);
3330

0 commit comments

Comments
 (0)