Commit d476c06
committed
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.1 parent ddaf8a6 commit d476c06
1 file changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
292 | | - | |
| 292 | + | |
| 293 | + | |
293 | 294 | | |
294 | 295 | | |
295 | 296 | | |
| |||
0 commit comments