diff --git a/vm/src/function.rs b/vm/src/function.rs index 902920d9b..ab4d35fc7 100644 --- a/vm/src/function.rs +++ b/vm/src/function.rs @@ -196,10 +196,9 @@ impl FuncArgs { T::arity().end(), given_args, ))) + } else if let Some(err) = self.check_kwargs_empty(vm) { + Err(err) } else { - if let Some(err) = self.check_kwargs_empty(vm) { - return Err(err); - } Ok(bound) } } diff --git a/vm/src/lib.rs b/vm/src/lib.rs index 9204867a5..bcd00bb68 100644 --- a/vm/src/lib.rs +++ b/vm/src/lib.rs @@ -7,8 +7,6 @@ // for methods like vm.to_str(), not the typical use of 'to' as a method prefix #![allow(clippy::wrong_self_convention, clippy::implicit_hasher)] -// clippy warns on this for macro generated code rust-clippy/issues/6249 -#![allow(clippy::suspicious_else_formatting)] // to allow `mod foo {}` in foo.rs; clippy thinks this is a mistake/misunderstanding of // how `mod` works, but we want this sometimes for pymodule declarations #![allow(clippy::module_inception)]