You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This extracts the logic that calls `fstat`, transforms the mode
with `let_readers_execute`, and writes it back through the same
file descriptor with `fchmod`, introducing a new helper function,
`set_executable`, for it.
The reason to do this is that it makes the issue of what kind of
`Error` appears in the returned `Result` clearer. This may be
slightly clearer to humans. It's significnatly clearer to the Rust
compiler, allowing both `map_err(std::io::Error::from)` calls to
be eliminated without having to write anything confusing or
inelegant.
(This is separate from the reason the `let_readers_execute`
function, which does not access the filesystem, is its own
function. That is so it's easy to test the mode transformation
logic.)
0 commit comments