Skip to content

Clippy #172

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion nanvm-lib/src/big_numbers/big_uint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ impl Mul for &BigUint {
let mut value = new_resize(total_max + 1);
let mut i: usize = 0;
while i < total_max {
let mut j = if i > rhs_max { i - rhs_max } else { 0 };
let mut j = i.saturating_sub(rhs_max);
let max = if i < lhs_max { i } else { lhs_max };
while j <= max {
value = add_to_vec(value, i, self.value[j] as u128 * other.value[i - j] as u128);
Expand Down
4 changes: 2 additions & 2 deletions nanvm-lib/src/js/js_bigint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ fn mul_vec(lhs: &[u64], rhs: &[u64]) -> Vec<u64> {
let mut vec = new_resize(total_max + 1);
let mut i: usize = 0;
while i < total_max {
let mut j = if i > rhs_max { i - rhs_max } else { 0 };
let mut j = i.saturating_sub(rhs_max);
let max = if i < lhs_max { i } else { lhs_max };
while j <= max {
vec = add_to_vec(vec, i, lhs[j] as u128 * rhs[i - j] as u128);
Expand Down Expand Up @@ -378,7 +378,7 @@ pub fn equals(lhs: &JsBigint, rhs: &JsBigint) -> bool {
if lhs.sign() != rhs.sign() {
return false;
}
return cmp_vec(lhs.items(), rhs.items()) == Ordering::Equal;
cmp_vec(lhs.items(), rhs.items()) == Ordering::Equal
}

fn to_twos_complement(value: &JsBigint) -> TwosComplement {
Expand Down
4 changes: 2 additions & 2 deletions nanvm-lib/src/mem/arena.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ impl BlockHeader for NoHeader {
}
}

impl<'a> Dealloc for &Arena<'a> {
impl Dealloc for &Arena<'_> {
type BlockHeader = NoHeader;
#[inline(always)]
unsafe fn dealloc(_: *mut u8, _: Layout) {}
}

impl<'a> Manager for &Arena<'a> {
impl Manager for &Arena<'_> {
type Dealloc = Self;
unsafe fn alloc(self, layout: Layout) -> *mut u8 {
let result = {
Expand Down
Loading