diff --git a/src/repo/datastore/flatfs.rs b/src/repo/datastore/flatfs.rs index 20dd56b72..0b682811e 100644 --- a/src/repo/datastore/flatfs.rs +++ b/src/repo/datastore/flatfs.rs @@ -20,8 +20,6 @@ use tokio_util::either::Either; /// their indirect descendants. Pin files are separated by their file extensions. /// /// When modifying, single lock is used. -/// -/// For the [`crate::repo::PinStore`] implementation see `fs/pinstore.rs`. #[derive(Debug)] pub struct FsDataStore { /// The base directory under which we have a sharded directory structure, and the individual @@ -439,7 +437,7 @@ impl PinStore for FsDataStore { async fn list( &self, requirement: Option, - ) -> futures::stream::BoxStream<'static, Result<(Cid, PinMode), Error>> { + ) -> BoxStream<'static, Result<(Cid, PinMode), Error>> { // no locking, dirty reads are probably good enough until gc let cids = self.list_pinfiles().await; diff --git a/src/repo/mod.rs b/src/repo/mod.rs index 1c2cedf28..832aacae5 100644 --- a/src/repo/mod.rs +++ b/src/repo/mod.rs @@ -184,7 +184,7 @@ pub trait Lock: Debug + Send + Sync { fn try_exclusive(&self) -> Result<(), LockError>; } -type References<'a> = futures::stream::BoxStream<'a, Result>; +type References<'a> = BoxStream<'a, Result>; #[async_trait] pub trait PinStore: Debug + Send + Sync { @@ -303,12 +303,11 @@ pub enum PinKind> { impl> PinKind { fn as_ref(&self) -> PinKind<&'_ Cid> { - use PinKind::*; match self { - IndirectFrom(c) => PinKind::IndirectFrom(c.borrow()), - Direct => PinKind::Direct, - Recursive(count) => PinKind::Recursive(*count), - RecursiveIntention => PinKind::RecursiveIntention, + PinKind::IndirectFrom(c) => PinKind::IndirectFrom(c.borrow()), + PinKind::Direct => PinKind::Direct, + PinKind::Recursive(count) => PinKind::Recursive(*count), + PinKind::RecursiveIntention => PinKind::RecursiveIntention, } } } @@ -964,7 +963,7 @@ impl Repo { pub async fn list_pins( &self, mode: impl Into>, - ) -> futures::stream::BoxStream<'static, Result<(Cid, PinMode), Error>> { + ) -> BoxStream<'static, Result<(Cid, PinMode), Error>> { let mode = mode.into(); self.inner.data_store.list(mode).await } @@ -1128,8 +1127,8 @@ impl RepoFetch { } } -impl std::future::IntoFuture for RepoFetch { - type Output = Result<(), anyhow::Error>; +impl IntoFuture for RepoFetch { + type Output = Result<(), Error>; type IntoFuture = BoxFuture<'static, Self::Output>; @@ -1257,8 +1256,8 @@ impl RepoInsertPin { } } -impl std::future::IntoFuture for RepoInsertPin { - type Output = Result<(), anyhow::Error>; +impl IntoFuture for RepoInsertPin { + type Output = Result<(), Error>; type IntoFuture = BoxFuture<'static, Self::Output>; @@ -1332,8 +1331,8 @@ impl RepoRemovePin { } } -impl std::future::IntoFuture for RepoRemovePin { - type Output = Result<(), anyhow::Error>; +impl IntoFuture for RepoRemovePin { + type Output = Result<(), Error>; type IntoFuture = BoxFuture<'static, Self::Output>; @@ -1363,7 +1362,7 @@ impl std::future::IntoFuture for RepoRemovePin { .refs .with_only_unique() .with_existing_blocks() - .refs_of_resolved(&repo, vec![(cid, ipld.clone())]) + .refs_of_resolved(&repo, vec![(cid, ipld)]) .map_ok(|crate::refs::Edge { destination, .. }| destination) .into_stream() .boxed();