Skip to content

Commit 69ac259

Browse files
authored
Merge pull request #214 from evanrelf/main
Don't generate invalid non-zero integers
2 parents 9132f5a + 213069e commit 69ac259

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/foreign/core/num.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use {
2-
crate::{Arbitrary, Error, MaxRecursionReached, Result, Unstructured},
2+
crate::{Arbitrary, MaxRecursionReached, Result, Unstructured},
33
core::{
44
mem,
55
num::{
@@ -96,7 +96,7 @@ macro_rules! implement_nonzero_int {
9696
fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self> {
9797
match Self::new(<$int as Arbitrary<'a>>::arbitrary(u)?) {
9898
Some(n) => Ok(n),
99-
None => Err(Error::IncorrectFormat),
99+
None => Ok(Self::new(<$int>::MAX).unwrap()),
100100
}
101101
}
102102

0 commit comments

Comments
 (0)