add max value from iterator
This commit is contained in:
parent
dd6e8c5f18
commit
8f19d5c3f6
2 changed files with 4 additions and 0 deletions
|
@ -15,12 +15,14 @@ use std::panic;
|
|||
fn main() {
|
||||
let r = panic::catch_unwind(|| {
|
||||
let mut it = u8::max_value()..;
|
||||
it.next().unwrap(); // 255
|
||||
it.next().unwrap();
|
||||
});
|
||||
assert!(r.is_err());
|
||||
|
||||
let r = panic::catch_unwind(|| {
|
||||
let mut it = i8::max_value()..;
|
||||
it.next().unwrap(); // 127
|
||||
it.next().unwrap();
|
||||
});
|
||||
assert!(r.is_err());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue