Skip to content

Commit 2279c34

Browse files
Update src/escape.rs
Co-authored-by: Jiahao XU <Jiahao_XU@outlook.com>
1 parent 74ecfc7 commit 2279c34

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/escape.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ fn whitelisted(byte: u8) -> bool {
2929
///
3030
pub fn escape(s: &OsStr) -> Cow<'_, OsStr> {
3131
let s = s.as_bytes();
32-
let all_whitelisted = s.iter().all(|x| whitelisted(*x));
32+
let all_whitelisted = s.iter().copied().all(whitelisted);
3333

3434
if !s.is_empty() && all_whitelisted {
3535
return OsString::from_vec(s.to_vec()).into();

0 commit comments

Comments
 (0)