Skip to content

Commit

Permalink
Fix initial review
Browse files Browse the repository at this point in the history
  • Loading branch information
leoyvens committed Sep 13, 2017
1 parent c2fb70b commit 9218e44
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/librustc/middle/lang_items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ impl LanguageItems {
}

pub fn require(&self, it: LangItem) -> Result<DefId, String> {
self.items[it as usize].ok_or(format!("requires `{}` lang_item", it.name()))
self.items[it as usize].ok_or_else(|| format!("requires `{}` lang_item", it.name()))
}

pub fn fn_trait_kind(&self, id: DefId) -> Option<ty::ClosureKind> {
match Some(id) {
x if x == self.fn_trait() => Some(ty::ClosureKind::Fn),
x if x == self.fn_mut_trait() => Some(ty::ClosureKind::FnMut),
x if x == self.fn_once_trait() => Some(ty::ClosureKind::FnOnce),
x if x == self.fn_once_trait() => Some(ty::ClosureKind::FnOnce),
_ => None
}
}
Expand Down

0 comments on commit 9218e44

Please sign in to comment.