chore(tvix/store/pathinfosvc): clippy

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
This commit is contained in:
Florian Klink 2023-06-17 13:20:56 +03:00 committed by clbot
parent b10f008b03
commit ad687ccaf4
2 changed files with 8 additions and 11 deletions

View file

@ -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(

View file

@ -74,8 +74,7 @@ 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() == "/" {
} else if url.path() == "/" {
Err(crate::Error::StorageError(
"cowardly refusing to open / with sled".to_string(),
))
@ -84,7 +83,6 @@ impl PathInfoService for SledPathInfoService {
.map_err(|e| Error::StorageError(e.to_string()))
}
}
}
fn get(&self, digest: [u8; 20]) -> Result<Option<proto::PathInfo>, Error> {
match self.db.get(digest) {