Skip to content

Commit 3c38845

Browse files
youknowdotcodex
authored andcommitted
Use expect_err for invalid borrowed descriptor
Satisfy clippy::err_expect while preserving the existing EBADF conversion. Borrowed descriptors implement Debug on all supported and unsupported host targets. Assisted-by: dot:frontier-intelligence
1 parent a851f69 commit 3c38845

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎crates/vm/src/ospath_fd.rs‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ impl PathConverter {
1919
self.try_path_or_fd_allow_invalid(obj, vm)?.ok_or_else(|| {
2020
// Preserve the usual EBADF result for the -1 descriptor.
2121
unsafe { crt_fd::Borrowed::try_borrow_raw(-1) }
22-
.err()
23-
.expect("-1 is not a valid borrowed descriptor")
22+
.expect_err("-1 is not a valid borrowed descriptor")
2423
.into_pyexception(vm)
2524
})
2625
}

0 commit comments

Comments
 (0)