Skip to content

Commit

Permalink
Fix feature_gate::find_lang_feature_issue() to not use unwrap()
Browse files Browse the repository at this point in the history
  • Loading branch information
abonander committed Jan 17, 2017
1 parent 375cbd2 commit 6843961
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/libsyntax/feature_gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}
}
}

Expand Down

0 comments on commit 6843961

Please sign in to comment.