clippy fix

main
NotAFile 2022-02-15 21:41:01 +01:00
parent 6148c599b8
commit 5ac51f8c5f
1 changed files with 3 additions and 3 deletions

View File

@ -105,13 +105,13 @@ impl Context {
}
fn try_get_type(&self, typename: &str) -> Result<Type, CompileError> {
self.typenames.get(typename).map(|t| *t).ok_or_else(|| {
self.typenames.get(typename).copied().ok_or_else(|| {
CompileError::new(CompileErrorKind::UndefinedReference(typename.to_owned()))
})
}
fn try_get_callable(&self, callname: &str) -> Result<&Callable, CompileError> {
self.callables.get(callname).map(|t| t).ok_or_else(|| {
self.callables.get(callname).ok_or_else(|| {
CompileError::new(CompileErrorKind::UndefinedReference(callname.to_owned()))
})
}
@ -182,7 +182,7 @@ impl Context {
}
let ret_typename = &comb.ret.name;
let ret_type = self.try_get_type(&ret_typename.fragment())?;
let ret_type = self.try_get_type(ret_typename.fragment())?;
let root_expr = self.type_expression(&comb.expr)?;