Skip to content

Commit

Permalink
Fix an MSRV incompatibility
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
EliahKagan committed Jan 12, 2025
1 parent be0abaf commit 61174e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/tools/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,7 @@ pub fn umask() -> u32 {
.expect("can execute `sh -c umask`");
assert!(output.status.success(), "`sh -c umask` failed");
assert!(output.stderr.is_empty(), "`sh -c umask` unexpected message");
let text = output.stdout.trim_ascii().to_str().expect("valid Unicode");
let text = output.stdout.to_str().expect("valid Unicode").trim();
u32::from_str_radix(text, 8).expect("parses as octal number")
}

Expand Down

0 comments on commit 61174e5

Please sign in to comment.