Skip to content
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

Automated nightly rustfmt (2024-12-01) #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
9 changes: 5 additions & 4 deletions hashes/src/siphash24.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ pub struct HashEngine {
k0: u64,
k1: u64,
bytes_hashed: u64, // how many bytes we've processed
state: State, // hash State
tail: u64, // unprocessed bytes le
ntail: usize, // how many bytes in tail are valid
state: State, // hash State
tail: u64, // unprocessed bytes le
ntail: usize, // how many bytes in tail are valid
}

impl HashEngine {
Expand Down Expand Up @@ -134,7 +134,8 @@ impl crate::HashEngine for HashEngine {

if self.ntail != 0 {
needed = 8 - self.ntail;
self.tail |= unsafe { u8to64_le(msg, 0, cmp::min(bytes_hashed, needed)) } << (8 * self.ntail);
self.tail |=
unsafe { u8to64_le(msg, 0, cmp::min(bytes_hashed, needed)) } << (8 * self.ntail);
if bytes_hashed < needed {
self.ntail += bytes_hashed;
return;
Expand Down
26 changes: 7 additions & 19 deletions units/src/fee_rate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! Implements `FeeRate` and assoctiated features.

use core::fmt;
use core::ops::{Add, Sub, Div, Mul, AddAssign, SubAssign};
use core::ops::{Add, AddAssign, Div, Mul, Sub, SubAssign};

#[cfg(feature = "arbitrary")]
use arbitrary::{Arbitrary, Unstructured};
Expand Down Expand Up @@ -154,25 +154,19 @@ impl Add for FeeRate {
impl Add<FeeRate> for &FeeRate {
type Output = FeeRate;

fn add(self, other: FeeRate) -> <FeeRate as Add>::Output {
FeeRate(self.0 + other.0)
}
fn add(self, other: FeeRate) -> <FeeRate as Add>::Output { FeeRate(self.0 + other.0) }
}

impl Add<&FeeRate> for FeeRate {
type Output = FeeRate;

fn add(self, other: &FeeRate) -> <FeeRate as Add>::Output {
FeeRate(self.0 + other.0)
}
fn add(self, other: &FeeRate) -> <FeeRate as Add>::Output { FeeRate(self.0 + other.0) }
}

impl<'a, 'b> Add<&'a FeeRate> for &'b FeeRate {
type Output = FeeRate;

fn add(self, other: &'a FeeRate) -> <FeeRate as Add>::Output {
FeeRate(self.0 + other.0)
}
fn add(self, other: &'a FeeRate) -> <FeeRate as Add>::Output { FeeRate(self.0 + other.0) }
}

impl Sub for FeeRate {
Expand All @@ -184,25 +178,19 @@ impl Sub for FeeRate {
impl Sub<FeeRate> for &FeeRate {
type Output = FeeRate;

fn sub(self, other: FeeRate) -> <FeeRate as Add>::Output {
FeeRate(self.0 - other.0)
}
fn sub(self, other: FeeRate) -> <FeeRate as Add>::Output { FeeRate(self.0 - other.0) }
}

impl Sub<&FeeRate> for FeeRate {
type Output = FeeRate;

fn sub(self, other: &FeeRate) -> <FeeRate as Add>::Output {
FeeRate(self.0 - other.0)
}
fn sub(self, other: &FeeRate) -> <FeeRate as Add>::Output { FeeRate(self.0 - other.0) }
}

impl<'a, 'b> Sub<&'a FeeRate> for &'b FeeRate {
type Output = FeeRate;

fn sub(self, other: &'a FeeRate) -> <FeeRate as Add>::Output {
FeeRate(self.0 - other.0)
}
fn sub(self, other: &'a FeeRate) -> <FeeRate as Add>::Output { FeeRate(self.0 - other.0) }
}

/// Computes the ceiling so that the fee computation is conservative.
Expand Down