Fix feature_gate::find_lang_feature_issue()
to not use unwrap()
This commit is contained in:
parent
375cbd20cf
commit
68439614ba
@ -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…
Reference in New Issue
Block a user