Skip to content

Commit ad5aaf4

Browse files
committed
.unwrap() -> .expect()
1 parent d36b699 commit ad5aaf4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/typechecker.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1737,7 +1737,7 @@ impl<'a> Typechecker<'a> {
17371737
}
17381738

17391739
if simple_types.len() == 1 {
1740-
*simple_types.iter().next().unwrap()
1740+
*simple_types.iter().next().expect("should have exactly 1 element")
17411741
} else {
17421742
self.oneof_types.push(simple_types);
17431743
self.push_type(Type::OneOf(OneOfId(self.oneof_types.len() - 1)))
@@ -1852,7 +1852,7 @@ impl<'a> Typechecker<'a> {
18521852
let single_res = if res.is_empty() {
18531853
TOP_TYPE
18541854
} else if res.len() == 1 {
1855-
*res.iter().next().unwrap()
1855+
*res.iter().next().expect("should have exactly 1 element")
18561856
} else {
18571857
self.allof_types.push(res);
18581858
self.push_type(Type::AllOf(AllOfId(self.allof_types.len() - 1)))

0 commit comments

Comments
 (0)