Skip to content

Commit

Permalink
Fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jac3km4 committed Feb 14, 2021
1 parent e28241e commit 925f504
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions compiler/src/assembler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,9 @@ impl Assembler {
Expr::Cast(type_name, expr, pos) => {
if let TypeId::Class(class) = scope.resolve_type(type_name, pool, *pos)? {
self.emit(Instr::DynamicCast(class, 0));
match scope.infer_type(expr, None, pool)? {
TypeId::WeakRef(_) => self.compile_conversion(Conversion::WeakRefToRef),
_ => {}
};
if let TypeId::WeakRef(_) = scope.infer_type(expr, None, pool)? {
self.compile_conversion(Conversion::WeakRefToRef)
}
self.compile(expr, None, pool, scope)?;
} else {
return Err(Error::CompileError(
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ impl<'a> Compiler<'a> {
SourceEntry::Function(fun) => {
let pos = fun.declaration.pos;
let idx = self.define_function(fun, PoolIndex::UNDEFINED)?;
if let Some(_) = compiled_funs.iter().find(|f| **f == idx) {
if compiled_funs.iter().find(|f| **f == idx).is_some() {
diagnostics.push(Diagnostic::MethodConflict(idx, pos));
} else {
compiled_funs.push(idx);
Expand Down

0 comments on commit 925f504

Please sign in to comment.