diff options
Diffstat (limited to 'tvix/store')
-rw-r--r-- | tvix/store/src/pathinfoservice/from_addr.rs | 5 | ||||
-rw-r--r-- | tvix/store/src/pathinfoservice/sled.rs | 14 |
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())) } } |