Merge pull request #339 from ZapAnton/fix_needless_return

Fixed the 'needless_return' clippy warnings
This commit is contained in:
Windel Bouwman
2019-02-05 22:30:32 +01:00
committed by GitHub
3 changed files with 4 additions and 8 deletions

View File

@@ -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));

View File

@@ -1081,5 +1081,5 @@ fn make_title(s: &str) -> String {
capitalize_char = true;
}
}
return titled_str;
titled_str
}

View File

@@ -827,7 +827,7 @@ impl PyFuncArgs {
kwargs: self.kwargs.clone(),
};
args.args.insert(0, item);
return args;
args
}
pub fn shift(&mut self) -> PyObjectRef {