diff --git a/mater/lib/src/file_reader.rs b/mater/lib/src/file_reader.rs index 3670cc501..e663bc214 100644 --- a/mater/lib/src/file_reader.rs +++ b/mater/lib/src/file_reader.rs @@ -220,11 +220,11 @@ pub(crate) mod blockstore { } /// A read-only [`blockstore::Blockstore`] implementation of [`CarExtractor`]. - pub struct CarReadOnlyBlockstore { + pub struct ReadOnlyBlockstore { inner: RwLock>, } - impl CarReadOnlyBlockstore + impl ReadOnlyBlockstore where R: AsyncRead + AsyncSeek + Unpin + blockstore::cond_send::CondSync, { @@ -236,7 +236,7 @@ pub(crate) mod blockstore { } } - impl CarReadOnlyBlockstore { + impl ReadOnlyBlockstore { /// Create a new [`CarReadOnlyBlockstore`](CarReadOnlyBlockstore) from the given path. pub async fn from_path

(path: P) -> Result where @@ -246,7 +246,7 @@ pub(crate) mod blockstore { } } - impl Deref for CarReadOnlyBlockstore { + impl Deref for ReadOnlyBlockstore { type Target = RwLock>; fn deref(&self) -> &Self::Target { @@ -254,7 +254,7 @@ pub(crate) mod blockstore { } } - impl Blockstore for CarReadOnlyBlockstore + impl Blockstore for ReadOnlyBlockstore where R: AsyncRead + AsyncSeek + Unpin + Send + Sync, { @@ -318,7 +318,7 @@ pub(crate) mod blockstore { multicodec::generate_multihash, test_utils::assert_buffer_eq, IDENTITY_CODE, RAW_CODE, }; - type FileBlockstore = CarReadOnlyBlockstore; + type FileBlockstore = ReadOnlyBlockstore; #[tokio::test] async fn test_identity_cid() { diff --git a/mater/lib/src/lib.rs b/mater/lib/src/lib.rs index 6674c3085..ae0b3a072 100644 --- a/mater/lib/src/lib.rs +++ b/mater/lib/src/lib.rs @@ -37,7 +37,7 @@ pub mod blockstore { pub use blockstore::Blockstore; pub use blockstore::Error; - pub use crate::file_reader::blockstore::CarReadOnlyBlockstore; + pub use crate::file_reader::blockstore::ReadOnlyBlockstore; } /// CAR handling errors. diff --git a/storage-retrieval/lib/examples/simple_server.rs b/storage-retrieval/lib/examples/simple_server.rs index cf263d3b2..649152cf0 100644 --- a/storage-retrieval/lib/examples/simple_server.rs +++ b/storage-retrieval/lib/examples/simple_server.rs @@ -6,7 +6,7 @@ use std::sync::Arc; use anyhow::Result; use libp2p::Multiaddr; -use mater::blockstore::CarReadOnlyBlockstore; +use mater::blockstore::ReadOnlyBlockstore; use polka_storage_retrieval::server::Server; #[tokio::main] @@ -16,10 +16,8 @@ async fn main() -> Result<()> { // Example blockstore providing only a single file. let blockstore = Arc::new( - CarReadOnlyBlockstore::from_path( - "./mater/lib/tests/fixtures/car_v2/spaceglenda_wrapped.car", - ) - .await?, + ReadOnlyBlockstore::from_path("./mater/lib/tests/fixtures/car_v2/spaceglenda_wrapped.car") + .await?, ); let roots = blockstore.write().await.roots().await?;