Fix feature_gate::find_lang_feature_issue() to not use unwrap()
This commit is contained in:
parent
375cbd20cf
commit
68439614ba
1 changed files with 4 additions and 3 deletions
|
|
@ -896,9 +896,10 @@ fn find_lang_feature_issue(feature: &str) -> Option<u32> {
|
|||
issue
|
||||
} else {
|
||||
// search in Accepted or Removed features
|
||||
ACCEPTED_FEATURES.iter().chain(REMOVED_FEATURES.iter())
|
||||
.find(|t| t.0 == feature)
|
||||
.unwrap().2
|
||||
match ACCEPTED_FEATURES.iter().chain(REMOVED_FEATURES).find(|t| t.0 == feature) {
|
||||
Some(&(_, _, issue)) => issue,
|
||||
None => panic!("Feature `{}` is not declared anywhere", feature),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue