Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve warning suppressions in
finalize_entry
- Make the conditional `unused_variable` suppression specific to the `set_executable_after_creation` parameter, which is all that needs it. This also makes it more immediately clear that nothing along the lines of `chmod +x` is done (or relevant) on Windows. - Allow `useless_conversion` for the conversion from `u32` to `rustix::fs::RawMode`. The `RawMode` type is what `rustix::fs` calls `mode_t` as used for the `st_mode` field of a `stat` structure. On most operating systems, it is `u32`, but this is not guaranteed by POSIX (which does not even guarantee that it is unsigned). It is `u16` at least on macOS and possibly other systems, and I am unsure if there are systems this code can run on where it is some other type besides `u16` or `u32`. For now, this does not attempt to make that suppression conditional, even though it is only needed when `RawMode` is already `u32`. I don't if there is a good way to express the condition under which it should apply. If there is, then it could be made conditional or, if it is truly reliable, then the conversion itself could be made conditional (though I suspect it is omitted when not needed in release builds, by optimization).
- Loading branch information