Skip to content

Commit dc9a828

Browse files
waywardmonkeyscuviper
authored andcommitted
clippy: Remove unnecessary casts.
1 parent 9dbf8d6 commit dc9a828

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/biguint/shift.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ fn biguint_shl2(n: Cow<'_, BigUint>, digits: usize, shift: u8) -> BigUint {
3535

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

8080
if shift > 0 {
8181
let mut borrow = 0;
82-
let borrow_shift = big_digit::BITS as u8 - shift;
82+
let borrow_shift = big_digit::BITS - shift;
8383
for elem in data.iter_mut().rev() {
8484
let new_borrow = *elem << borrow_shift;
8585
*elem = (*elem >> shift) | borrow;

tests/bigint.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ fn test_signed_bytes_le_round_trip() {
187187

188188
#[test]
189189
fn test_cmp() {
190-
let vs: [&[u32]; 4] = [&[2 as u32], &[1, 1], &[2, 1], &[1, 1, 1]];
190+
let vs: [&[u32]; 4] = [&[2_u32], &[1, 1], &[2, 1], &[1, 1, 1]];
191191
let mut nums = Vec::new();
192192
for s in vs.iter().rev() {
193193
nums.push(BigInt::from_slice(Minus, *s));

0 commit comments

Comments
 (0)