Skip to content

Commit

Permalink
clippy: Remove unnecessary casts.
Browse files Browse the repository at this point in the history
  • Loading branch information
waywardmonkeys authored and cuviper committed Aug 22, 2023
1 parent 9dbf8d6 commit dc9a828
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/biguint/shift.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ fn biguint_shl2(n: Cow<'_, BigUint>, digits: usize, shift: u8) -> BigUint {

if shift > 0 {
let mut carry = 0;
let carry_shift = big_digit::BITS as u8 - shift;
let carry_shift = big_digit::BITS - shift;
for elem in data[digits..].iter_mut() {
let new_carry = *elem >> carry_shift;
*elem = (*elem << shift) | carry;
Expand Down Expand Up @@ -79,7 +79,7 @@ fn biguint_shr2(n: Cow<'_, BigUint>, digits: usize, shift: u8) -> BigUint {

if shift > 0 {
let mut borrow = 0;
let borrow_shift = big_digit::BITS as u8 - shift;
let borrow_shift = big_digit::BITS - shift;
for elem in data.iter_mut().rev() {
let new_borrow = *elem << borrow_shift;
*elem = (*elem >> shift) | borrow;
Expand Down
2 changes: 1 addition & 1 deletion tests/bigint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ fn test_signed_bytes_le_round_trip() {

#[test]
fn test_cmp() {
let vs: [&[u32]; 4] = [&[2 as u32], &[1, 1], &[2, 1], &[1, 1, 1]];
let vs: [&[u32]; 4] = [&[2_u32], &[1, 1], &[2, 1], &[1, 1, 1]];
let mut nums = Vec::new();
for s in vs.iter().rev() {
nums.push(BigInt::from_slice(Minus, *s));
Expand Down

0 comments on commit dc9a828

Please sign in to comment.