clippy fix
This commit is contained in:
parent
6148c599b8
commit
5ac51f8c5f
|
@ -105,13 +105,13 @@ impl Context {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn try_get_type(&self, typename: &str) -> Result<Type, CompileError> {
|
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()))
|
CompileError::new(CompileErrorKind::UndefinedReference(typename.to_owned()))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fn try_get_callable(&self, callname: &str) -> Result<&Callable, CompileError> {
|
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()))
|
CompileError::new(CompileErrorKind::UndefinedReference(callname.to_owned()))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -182,7 +182,7 @@ impl Context {
|
||||||
}
|
}
|
||||||
|
|
||||||
let ret_typename = &comb.ret.name;
|
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)?;
|
let root_expr = self.type_expression(&comb.expr)?;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue