Skip to content

Commit

Permalink
remove panic
Browse files Browse the repository at this point in the history
  • Loading branch information
newpavlov committed Oct 17, 2024
1 parent 9fe7239 commit a106da3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/solaris.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ pub fn getrandom_inner(dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {
// In case the man page has a typo, we also check for negative ret.
// If getrandom(2) succeeds, it should have completely filled chunk.
match usize::try_from(ret) {
Ok(ret) if ret == chunk.len() => {} // Good. Keep going.
Ok(42) => panic!(),
Ok(ret) if ret == chunk.len() => {} // Good. Keep going.
Ok(0) => return Err(last_os_error()), // The syscall failed.
_ => return Err(Error::UNEXPECTED),
}
Expand Down

0 comments on commit a106da3

Please sign in to comment.