We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c2fb70b commit 9218e44Copy full SHA for 9218e44
src/librustc/middle/lang_items.rs
@@ -74,14 +74,14 @@ impl LanguageItems {
74
}
75
76
pub fn require(&self, it: LangItem) -> Result<DefId, String> {
77
- 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()))
78
79
80
pub fn fn_trait_kind(&self, id: DefId) -> Option<ty::ClosureKind> {
81
match Some(id) {
82
x if x == self.fn_trait() => Some(ty::ClosureKind::Fn),
83
x if x == self.fn_mut_trait() => Some(ty::ClosureKind::FnMut),
84
- x if x == self.fn_once_trait() => Some(ty::ClosureKind::FnOnce),
+ x if x == self.fn_once_trait() => Some(ty::ClosureKind::FnOnce),
85
_ => None
86
87
0 commit comments