Skip to content

Commit 674ca86

Browse files
committed
Tweak errno conversion
1 parent 3755642 commit 674ca86

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/linux_rustix.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pub fn getrandom_inner(mut dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {
2222
.raw_os_error()
2323
.wrapping_neg()
2424
.try_into()
25-
.expect("Errno uses u16 internally");
25+
.map_err(|_| Error::UNEXPECTED)?;
2626
return Err(Error::from_os_error(code));
2727
}
2828
}

0 commit comments

Comments
 (0)