diff --git a/fish-rust/src/builtins/random.rs b/fish-rust/src/builtins/random.rs index bcded00c5..9eb498255 100644 --- a/fish-rust/src/builtins/random.rs +++ b/fish-rust/src/builtins/random.rs @@ -165,10 +165,7 @@ fn parse( }; // Safe because end was a valid i64 and the result here is in the range start..=end. - let result: i64 = start - .checked_add_unsigned(rand * step) - .and_then(|x| x.try_into().ok()) - .unwrap(); + let result: i64 = (start as u64 + (rand * step) as u64) as i64; streams.out.append(sprintf!(L!("%d\n"), result)); return STATUS_CMD_OK;