chore(tvix/store/blobsvc): clippy
Change-Id: Ie384bdd27e1e9282ceda83edc74ffaad387f352b Reviewed-on: https://cl.tvl.fyi/c/depot/+/8810 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su> Autosubmit: flokli <flokli@flokli.de>
This commit is contained in:
		
							parent
							
								
									b399dad0ff
								
							
						
					
					
						commit
						71093a513a
					
				
					 2 changed files with 7 additions and 10 deletions
				
			
		| 
						 | 
				
			
			@ -12,9 +12,8 @@ use super::{BlobService, GRPCBlobService, MemoryBlobService, SledBlobService};
 | 
			
		|||
///
 | 
			
		||||
/// See their [from_url] methods for more details about their syntax.
 | 
			
		||||
pub fn from_addr(uri: &str) -> Result<Arc<dyn BlobService>, 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(MemoryBlobService::from_url(&url)?)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -47,8 +47,7 @@ impl BlobService for SledBlobService {
 | 
			
		|||
        // TODO: expose compression and other parameters as URL parameters, drop new and new_temporary?
 | 
			
		||||
        if url.path().is_empty() {
 | 
			
		||||
            Self::new_temporary().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(),
 | 
			
		||||
            ))
 | 
			
		||||
| 
						 | 
				
			
			@ -56,7 +55,6 @@ impl BlobService for SledBlobService {
 | 
			
		|||
            Self::new(url.path().into()).map_err(|e| Error::StorageError(e.to_string()))
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    #[instrument(skip(self), fields(blob.digest=%digest))]
 | 
			
		||||
    fn has(&self, digest: &B3Digest) -> Result<bool, Error> {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue