about summary refs log tree commit diff
path: root/tvix/store/src/pathinfoservice
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2023-06-17T10·20+0300
committerclbot <clbot@tvl.fyi>2023-06-19T14·29+0000
commitad687ccaf49f6cfd3b23083ddd543a840c2212ae (patch)
treece00017af6c5345bb2ccfe1404dd1b2e85f81e1c /tvix/store/src/pathinfoservice
parentb10f008b03f44192cb37cbd6cf1e55b6d03b80fa (diff)
chore(tvix/store/pathinfosvc): clippy r/6333
Change-Id: Ied4bed08e989791f832922da8776d2104035e28a
Reviewed-on: https://cl.tvl.fyi/c/depot/+/8812
Reviewed-by: tazjin <tazjin@tvl.su>
Autosubmit: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/store/src/pathinfoservice')
-rw-r--r--tvix/store/src/pathinfoservice/from_addr.rs5
-rw-r--r--tvix/store/src/pathinfoservice/sled.rs14
2 files changed, 8 insertions, 11 deletions
diff --git a/tvix/store/src/pathinfoservice/from_addr.rs b/tvix/store/src/pathinfoservice/from_addr.rs
index 2f712f451442..36b30aecdcf5 100644
--- a/tvix/store/src/pathinfoservice/from_addr.rs
+++ b/tvix/store/src/pathinfoservice/from_addr.rs
@@ -27,9 +27,8 @@ pub fn from_addr(
     blob_service: Arc<dyn BlobService>,
     directory_service: Arc<dyn DirectoryService>,
 ) -> Result<Arc<dyn PathInfoService>, crate::Error> {
-    let url = Url::parse(uri).map_err(|e| {
-        crate::Error::StorageError(format!("unable to parse url: {}", e.to_string()))
-    })?;
+    let url = Url::parse(uri)
+        .map_err(|e| crate::Error::StorageError(format!("unable to parse url: {}", e)))?;
 
     Ok(if url.scheme() == "memory" {
         Arc::new(MemoryPathInfoService::from_url(
diff --git a/tvix/store/src/pathinfoservice/sled.rs b/tvix/store/src/pathinfoservice/sled.rs
index 48db6b8b5cd8..3e5811b1d6ef 100644
--- a/tvix/store/src/pathinfoservice/sled.rs
+++ b/tvix/store/src/pathinfoservice/sled.rs
@@ -74,15 +74,13 @@ impl PathInfoService for SledPathInfoService {
         if url.path().is_empty() {
             Self::new_temporary(blob_service, directory_service)
                 .map_err(|e| Error::StorageError(e.to_string()))
+        } else if url.path() == "/" {
+            Err(crate::Error::StorageError(
+                "cowardly refusing to open / with sled".to_string(),
+            ))
         } else {
-            if url.path() == "/" {
-                Err(crate::Error::StorageError(
-                    "cowardly refusing to open / with sled".to_string(),
-                ))
-            } else {
-                Self::new(url.path().into(), blob_service, directory_service)
-                    .map_err(|e| Error::StorageError(e.to_string()))
-            }
+            Self::new(url.path().into(), blob_service, directory_service)
+                .map_err(|e| Error::StorageError(e.to_string()))
         }
     }