Skip to content

Commit e51c75e

Browse files
committed
Fixed or_fun_call clippy warnings
1 parent 56e2d4c commit e51c75e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

vm/src/obj/objsequence.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ pub trait PySliceableSequence {
4949
let stop = stop
5050
.as_ref()
5151
.map(|x| self.get_slice_pos(x))
52-
.unwrap_or(self.len());
52+
.unwrap_or_else(|| self.len());
5353

5454
start..stop
5555
}
@@ -65,7 +65,7 @@ pub trait PySliceableSequence {
6565
// TODO: we could potentially avoid this copy and use slice
6666
match &(slice.borrow()).payload {
6767
PyObjectPayload::Slice { start, stop, step } => {
68-
let step = step.clone().unwrap_or(BigInt::one());
68+
let step = step.clone().unwrap_or_else(BigInt::one);
6969
if step.is_zero() {
7070
Err(vm.new_value_error("slice step cannot be zero".to_string()))
7171
} else if step.is_positive() {

0 commit comments

Comments
 (0)