Skip to content

Commit

Permalink
Fix clippy and Rust 2024 warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
casey committed Feb 22, 2025
1 parent 03ada66 commit e6c1fb8
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions crates/ordinals/src/rune.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ impl Rune {
pub fn reserved(block: u64, tx: u32) -> Self {
Self(
Self::RESERVED
.checked_add(u128::from(block) << 32 | u128::from(tx))
.checked_add((u128::from(block) << 32) | u128::from(tx))
.unwrap(),
)
}
Expand Down Expand Up @@ -416,7 +416,7 @@ mod tests {
assert_eq!(Rune::reserved(1, 1), Rune(Rune::RESERVED + (1 << 32) + 1));
assert_eq!(
Rune::reserved(u64::MAX, u32::MAX),
Rune(Rune::RESERVED + (u128::from(u64::MAX) << 32 | u128::from(u32::MAX))),
Rune(Rune::RESERVED + ((u128::from(u64::MAX) << 32) | u128::from(u32::MAX))),
);
}

Expand Down
2 changes: 1 addition & 1 deletion crates/ordinals/src/spaced_rune.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ impl Display for SpacedRune {
for (i, c) in rune.chars().enumerate() {
write!(f, "{c}")?;

if i < rune.len() - 1 && self.spacers & 1 << i != 0 {
if i < rune.len() - 1 && self.spacers & (1 << i) != 0 {
write!(f, "•")?;
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/ordinals/src/varint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ mod tests {
let mut n = 0;

for i in 0..129 {
n = n << 1 | (i % 2);
n = (n << 1) | (i % 2);
let encoded = encode(n);
let (decoded, length) = decode(&encoded).unwrap();
assert_eq!(decoded, n);
Expand Down
2 changes: 1 addition & 1 deletion src/index/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ impl Entry for SatRange {
fn store(self) -> Self::Value {
let base = self.0;
let delta = self.1 - self.0;
let n = u128::from(base) | u128::from(delta) << 51;
let n = u128::from(base) | (u128::from(delta) << 51);
n.to_le_bytes()[0..11].try_into().unwrap()
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/index/updater/inscription_updater.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ impl InscriptionUpdater<'_, '_> {
// still have to normalize over inscription size
for flotsam in &mut floating_inscriptions {
if let Flotsam {
origin: Origin::New { ref mut fee, .. },
origin: Origin::New { fee, .. },
..
} = flotsam
{
Expand Down

0 comments on commit e6c1fb8

Please sign in to comment.