Skip to content

Commit 7d72433

Browse files
Merge pull request #8 from metaplex-foundation/fix/consistent-sentinel
Adding more consistent sentinel values for signed types.
2 parents 02ccf77 + 7c1a2cb commit 7d72433

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/pod/optional_integer.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ impl_integer_sentinel! {
2323
u32 => u32::MAX,
2424
u64 => u64::MAX,
2525
u128 => u128::MAX,
26-
i8 => i8::MIN,
27-
i16 => i16::MIN,
28-
i32 => i32::MIN,
29-
i64 => i64::MIN,
30-
i128 => i128::MIN
26+
i8 => i8::MAX,
27+
i16 => i16::MAX,
28+
i32 => i32::MAX,
29+
i64 => i64::MAX,
30+
i128 => i128::MAX
3131
}
3232

3333
#[repr(transparent)]
@@ -204,7 +204,7 @@ mod tests {
204204
#[test]
205205
#[should_panic(expected = "Cannot use sentinel value as Some")]
206206
fn test_sentinel_value_panic_i32() {
207-
OptionalI32::some(i32::MIN);
207+
OptionalI32::some(i32::MAX);
208208
}
209209

210210
#[test]

0 commit comments

Comments
 (0)