diff --git a/src/store.rs b/src/store.rs index 7664d4f..1c28cd3 100644 --- a/src/store.rs +++ b/src/store.rs @@ -15,12 +15,8 @@ use zarrs::storage::{ storage_adapter::async_to_sync::AsyncToSyncStorageAdapter, ReadableWritableListableStorageTraits, }; -use zarrs_opendal::AsyncOpendalStore; -use crate::{ - runtime::{tokio_block_on, TokioBlockOn}, - utils::PyErrExt, -}; +use crate::{runtime::tokio_block_on, utils::PyErrExt}; mod filesystem; mod http; @@ -82,9 +78,9 @@ impl TryFrom<&StoreConfigType> for Arc>; - -fn opendal_builder_to_sync_store(builder: B) -> PyResult { +fn opendal_builder_to_sync_store( + builder: B, +) -> PyResult> { let operator = opendal::Operator::new(builder) .map_py_err::()? .finish(); diff --git a/src/store/filesystem.rs b/src/store/filesystem.rs index 9cfe392..11da371 100644 --- a/src/store/filesystem.rs +++ b/src/store/filesystem.rs @@ -24,7 +24,7 @@ impl TryInto> for &FilesystemStor type Error = PyErr; fn try_into(self) -> Result, Self::Error> { - let store: Arc = + let store = Arc::new(FilesystemStore::new(self.root.clone()).map_py_err::()?); Ok(store) } diff --git a/src/store/http.rs b/src/store/http.rs index 110c0d3..e22d4c2 100644 --- a/src/store/http.rs +++ b/src/store/http.rs @@ -39,8 +39,6 @@ impl TryInto> for &HttpStoreConfi fn try_into(self) -> Result, Self::Error> { let builder = opendal::services::Http::default().endpoint(&self.root); - let store: Arc = - opendal_builder_to_sync_store(builder)?; - Ok(store) + opendal_builder_to_sync_store(builder) } }