Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Really convert the mode more portably
While replacing `into()` with `rustix::fs::Mode::from_bits(...)` helped in expressing (and enforcing) the desired semantics for bits that fit in `mode_t` but whose meaning is unrecognized, it did not actually make the code build on macOS, and probably was not enough to improve portability to any other systems where `mode_t` is not `u32`. This commit adds an explicit checked conversion of the value we get from calling `mode()` on a `Permissions` object, which is aways `u32`, into whatever type `mode_t` is defined as, which is `u32` on most systems but `u16` on macOS and possibly others.
- Loading branch information