Skip to content

Commit 61174e5

Browse files
committed
Fix an MSRV incompatibility
Trimming Unicode whitespace is not equivalent to trimming ASCII whitespace, but in this case I think they are equally okay to do. If we get Unicode whitespace that is not ASCII whitespace from running `umask`, in principle it's possible this is due to it being a misinterpretation of something not Unicode. But if `umask` gives us anything besides whitespace and a single nonempty sequence of octal digits, then (a) that's very strange, and (b) it should fail and indicate its failure with a nonzero exit status, which we check.
1 parent be0abaf commit 61174e5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/tools/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -953,7 +953,7 @@ pub fn umask() -> u32 {
953953
.expect("can execute `sh -c umask`");
954954
assert!(output.status.success(), "`sh -c umask` failed");
955955
assert!(output.stderr.is_empty(), "`sh -c umask` unexpected message");
956-
let text = output.stdout.trim_ascii().to_str().expect("valid Unicode");
956+
let text = output.stdout.to_str().expect("valid Unicode").trim();
957957
u32::from_str_radix(text, 8).expect("parses as octal number")
958958
}
959959

0 commit comments

Comments
 (0)