mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-09 22:49:57 +09:00
Merge pull request #339 from ZapAnton/fix_needless_return
Fixed the 'needless_return' clippy warnings
This commit is contained in:
@@ -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));
|
||||
|
||||
@@ -1081,5 +1081,5 @@ fn make_title(s: &str) -> String {
|
||||
capitalize_char = true;
|
||||
}
|
||||
}
|
||||
return titled_str;
|
||||
titled_str
|
||||
}
|
||||
|
||||
@@ -827,7 +827,7 @@ impl PyFuncArgs {
|
||||
kwargs: self.kwargs.clone(),
|
||||
};
|
||||
args.args.insert(0, item);
|
||||
return args;
|
||||
args
|
||||
}
|
||||
|
||||
pub fn shift(&mut self) -> PyObjectRef {
|
||||
|
||||
Reference in New Issue
Block a user