diff --git a/vm/src/obj/objint.rs b/vm/src/obj/objint.rs index 083741023..51e58a7d6 100644 --- a/vm/src/obj/objint.rs +++ b/vm/src/obj/objint.rs @@ -205,9 +205,7 @@ fn int_lshift(vm: &mut VirtualMachine, args: PyFuncArgs) -> PyResult { // i2 failed `to_usize()` conversion match get_value(i2) { - ref v if *v < BigInt::zero() => { - return Err(vm.new_value_error("negative shift count".to_string())); - } + ref v if *v < BigInt::zero() => Err(vm.new_value_error("negative shift count".to_string())), ref v if *v > BigInt::from(usize::max_value()) => { // TODO: raise OverflowError panic!("Failed converting {} to rust usize", get_value(i2)); @@ -237,9 +235,7 @@ fn int_rshift(vm: &mut VirtualMachine, args: PyFuncArgs) -> PyResult { // i2 failed `to_usize()` conversion match get_value(i2) { - ref v if *v < BigInt::zero() => { - return Err(vm.new_value_error("negative shift count".to_string())); - } + ref v if *v < BigInt::zero() => Err(vm.new_value_error("negative shift count".to_string())), ref v if *v > BigInt::from(usize::max_value()) => { // TODO: raise OverflowError panic!("Failed converting {} to rust usize", get_value(i2)); diff --git a/vm/src/obj/objstr.rs b/vm/src/obj/objstr.rs index 4eea5a966..2b840aa11 100644 --- a/vm/src/obj/objstr.rs +++ b/vm/src/obj/objstr.rs @@ -1081,5 +1081,5 @@ fn make_title(s: &str) -> String { capitalize_char = true; } } - return titled_str; + titled_str } diff --git a/vm/src/pyobject.rs b/vm/src/pyobject.rs index 69fc083a5..9fffb14d5 100644 --- a/vm/src/pyobject.rs +++ b/vm/src/pyobject.rs @@ -827,7 +827,7 @@ impl PyFuncArgs { kwargs: self.kwargs.clone(), }; args.args.insert(0, item); - return args; + args } pub fn shift(&mut self) -> PyObjectRef {