Skip to content

Commit 297df55

Browse files
rkuhnabailly
authored andcommitted
chore: mollify clippy
Signed-off-by: Roland Kuhn <rk@rkuhn.info>
1 parent 04b1eaf commit 297df55

4 files changed

Lines changed: 8 additions & 4 deletions

File tree

crates/amaru/src/stages/consensus/chain_forward.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ impl std::fmt::Debug for PrettyPoint<'_> {
140140
f,
141141
"({}, {})",
142142
self.0.slot_or_default(),
143-
hex::encode(hash_point(&self.0))
143+
hex::encode(hash_point(self.0))
144144
)
145145
}
146146
}

crates/amaru/src/stages/consensus/chain_forward/client_state.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ impl ClientState {
2929
ClientOp::Backward(tip) => {
3030
if let Some((index, _)) =
3131
self.ops.iter().enumerate().rfind(
32-
|(_, op)| matches!(op, ClientOp::Forward(_, tip2) if &tip2.0 == &tip.0),
32+
|(_, op)| matches!(op, ClientOp::Forward(_, tip2) if tip2.0 == tip.0),
3333
)
3434
{
3535
tracing::debug!("found backward op at index {index} in {:?}", self.ops);

crates/amaru/src/stages/consensus/chain_forward/test_infra.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ impl Client {
301301
}
302302

303303
#[derive(Clone)]
304+
#[allow(clippy::large_enum_variant)]
304305
pub enum ClientMsg {
305306
Forward(Header, Tip),
306307
Backward(Point, Tip),
@@ -319,7 +320,7 @@ impl std::fmt::Debug for ClientMsg {
319320
.finish(),
320321
Self::Backward(point, tip) => f
321322
.debug_struct("Backward")
322-
.field("point", &PrettyPoint(&point))
323+
.field("point", &PrettyPoint(point))
323324
.field("tip", &(tip.1, PrettyPoint(&tip.0)))
324325
.finish(),
325326
}

crates/amaru/src/stages/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,10 @@ pub fn bootstrap(
9090
.collect::<Vec<_>>();
9191
let chain_store = RocksDBStore::new(config.chain_dir.clone(), era_history)?;
9292

93-
let header: Header = chain_store.load_header(&Hash::from(&tip)).unwrap();
93+
#[allow(clippy::expect_used)]
94+
let header: Header = chain_store
95+
.load_header(&Hash::from(&tip))
96+
.expect("Tip not found");
9497
let our_tip = Tip(header.pallas_point(), header.block_height());
9598

9699
let chain_selector = make_chain_selector(tip.clone(), &chain_store, &peer_sessions)?;

0 commit comments

Comments
 (0)