Prefer Option::expect over explicit unwrapping.
This commit is contained in:
parent
0b9995b24c
commit
e1048b5ab6
1 changed files with 2 additions and 3 deletions
|
|
@ -93,9 +93,8 @@ fn parse_expected(last_nonfollow_error: Option<usize>,
|
|||
|
||||
let (which, line) = if follow {
|
||||
assert!(adjusts == 0, "use either //~| or //~^, not both.");
|
||||
let line = last_nonfollow_error.unwrap_or_else(|| {
|
||||
panic!("encountered //~| without preceding //~^ line.")
|
||||
});
|
||||
let line = last_nonfollow_error.expect("encountered //~| without \
|
||||
preceding //~^ line.");
|
||||
(FollowPrevious(line), line)
|
||||
} else {
|
||||
let which =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue