···156156 MaybeProcessedBlock::Processed(_) => Err(WalkError::BadCommitFingerprint)?,
157157 MaybeProcessedBlock::Raw(bytes) => (serde_ipld_dagcbor::from_slice(bytes)?, bytes.clone()),
158158 };
159159- let root_cid: Cid = commit.data.clone().into();
159159+ let root_cid: Cid = commit.data.into();
160160161161 Ok(MemCar {
162162 commit,
···194194 /// Returns all `WalkItem` variants as-is, including `MissingRecord` and
195195 /// `MissingSubtree` for sparse trees and CAR slices. Returns `Ok(None)`
196196 /// when the walk is complete.
197197- ///
198198- /// TODO: make this an implementation of Iterator
197197+ #[allow(clippy::should_implement_trait)]
199198 pub fn next(&mut self) -> Result<Option<WalkItem>, WalkError> {
200199 self.walker.step(&self.blocks, self.process)
201200 }
···424423 (serde_ipld_dagcbor::from_slice(bytes)?, bytes.clone())
425424 }
426425 };
427427- let root_cid: Cid = commit.data.clone().into();
426426+ let root_cid: Cid = commit.data.into();
428427429428 Ok(MemCar {
430429 commit,
···509508 .map_err(|e| DriveError::StorageError(DiskError::DbError(e)))?
510509 .ok_or(DriveError::MissingCommit)?;
511510512512- let root_cid: Cid = commit.data.clone().into();
511511+ let root_cid: Cid = commit.data.into();
513512 let (node, root_bytes) = match MaybeProcessedBlock::from_bytes(db_bytes.to_vec()) {
514513 MaybeProcessedBlock::Processed(_) => Err(WalkError::BadCommitFingerprint)?,
515514 MaybeProcessedBlock::Raw(bytes) => (serde_ipld_dagcbor::from_slice(&bytes)?, bytes),
+1
src/slice.rs
···138138 ///
139139 /// Errors on any missing block within the range, on an MST node absent
140140 /// within the range, or on a proof violation.
141141+ #[allow(clippy::should_implement_trait)]
141142 pub fn next(&mut self) -> Result<Option<Output>, SliceError> {
142143 if self.done {
143144 return Ok(None);
+10-1
src/walk.rs
···112112 MissingSubtree { cid: Cid },
113113}
114114115115+impl WalkItem {
116116+ pub fn is_missing(&self) -> bool {
117117+ matches!(
118118+ self,
119119+ Self::MissingRecord { .. } | Self::MissingSubtree { .. }
120120+ )
121121+ }
122122+}
123123+115124/// A single record emitted by the walker.
116125#[derive(Debug, PartialEq)]
117126pub struct Output<T = Bytes> {
···279288280289 // Capture what we need to emit a Node item after mpb_step consumes `thing`.
281290 let child_link = if matches!(thing.kind, ThingKind::ChildNode) {
282282- Some(thing.link.clone())
291291+ Some(thing.link)
283292 } else {
284293 None
285294 };