minor code cleanups

This commit is contained in:
auronandace
2026-04-03 14:39:56 +01:00
parent 19b0b44eb9
commit b4009544a8
4 changed files with 9 additions and 14 deletions
+1 -2
View File
@@ -578,10 +578,9 @@ pub unsafe extern "C" fn fopen(filename: *const c_char, mode: *const c_char) ->
helpers::_fdopen(fd, unsafe { CStr::from_ptr(mode) })
.map(Box::into_raw)
.map_err(|err| {
.inspect_err(|err| {
// TODO: guard type
if let Ok(()) = Sys::close(fd) {}; // TODO handle error
err
})
.or_errno_null_mut()
}
+1 -2
View File
@@ -610,9 +610,8 @@ impl<'a, T: c_str::Kind> Iterator for PrintfIter<'a, T> {
self.format = first_percent.split_first().expect("must be %").1;
let mut peekahead = self.format;
let index = pop_index(&mut peekahead).map(|i| {
let index = pop_index(&mut peekahead).inspect(|i| {
self.format = peekahead;
i
});
// Flags: