Skip to content

Commit e1048b5

Browse files
committed
Prefer Option::expect over explicit unwrapping.
1 parent 0b9995b commit e1048b5

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/compiletest/errors.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,8 @@ fn parse_expected(last_nonfollow_error: Option<usize>,
9393

9494
let (which, line) = if follow {
9595
assert!(adjusts == 0, "use either //~| or //~^, not both.");
96-
let line = last_nonfollow_error.unwrap_or_else(|| {
97-
panic!("encountered //~| without preceding //~^ line.")
98-
});
96+
let line = last_nonfollow_error.expect("encountered //~| without \
97+
preceding //~^ line.");
9998
(FollowPrevious(line), line)
10099
} else {
101100
let which =

0 commit comments

Comments
 (0)