Fix feature_gate::find_lang_feature_issue() to not use unwrap()

This commit is contained in:
Austin Bonander 2017-01-16 17:59:11 -08:00
parent 375cbd20cf
commit 68439614ba

View File

@ -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),
}
}
}