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:
		
							parent
							
								
									b10f008b03
								
							
						
					
					
						commit
						ad687ccaf4
					
				
					 2 changed files with 8 additions and 11 deletions
				
			
		| 
						 | 
				
			
			@ -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(
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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()))
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue