refactor(tvix/store): don't use anyhow::Result<()> in tests
It's much easier to just unwrap the TempDir::new() result. Change-Id: I7b05bc18f3146401e30e1cc2bb412503c5171a66 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8128 Reviewed-by: raitobezarius <tvl@lahfa.xyz> Tested-by: BuildkiteCI
This commit is contained in:
		
							parent
							
								
									df3223fd68
								
							
						
					
					
						commit
						bc3f71838f
					
				
					 1 changed files with 6 additions and 11 deletions
				
			
		| 
						 | 
				
			
			@ -62,8 +62,8 @@ fn gen_directory_service(p: &Path) -> impl DirectoryService {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
#[test]
 | 
			
		||||
fn single_symlink() -> anyhow::Result<()> {
 | 
			
		||||
    let tmpdir = TempDir::new()?;
 | 
			
		||||
fn single_symlink() {
 | 
			
		||||
    let tmpdir = TempDir::new().unwrap();
 | 
			
		||||
    let renderer = NARRenderer::new(
 | 
			
		||||
        gen_blob_service(tmpdir.path()),
 | 
			
		||||
        gen_chunk_service(tmpdir.path()),
 | 
			
		||||
| 
						 | 
				
			
			@ -98,12 +98,11 @@ fn single_symlink() -> anyhow::Result<()> {
 | 
			
		|||
            1, 0, 0, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 0 // ")"
 | 
			
		||||
        ]
 | 
			
		||||
    );
 | 
			
		||||
    Ok(())
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#[test]
 | 
			
		||||
fn single_file() -> anyhow::Result<()> {
 | 
			
		||||
    let tmpdir = TempDir::new()?;
 | 
			
		||||
fn single_file() {
 | 
			
		||||
    let tmpdir = TempDir::new().unwrap();
 | 
			
		||||
 | 
			
		||||
    let blob_service = gen_blob_service(tmpdir.path());
 | 
			
		||||
    let chunk_service = gen_chunk_service(tmpdir.path());
 | 
			
		||||
| 
						 | 
				
			
			@ -158,13 +157,11 @@ fn single_file() -> anyhow::Result<()> {
 | 
			
		|||
            1, 0, 0, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 0 // ")"
 | 
			
		||||
        ]
 | 
			
		||||
    );
 | 
			
		||||
 | 
			
		||||
    Ok(())
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#[test]
 | 
			
		||||
fn test_complicated() -> anyhow::Result<()> {
 | 
			
		||||
    let tmpdir = TempDir::new()?;
 | 
			
		||||
fn test_complicated() {
 | 
			
		||||
    let tmpdir = TempDir::new().unwrap();
 | 
			
		||||
 | 
			
		||||
    let blob_service = gen_blob_service(tmpdir.path());
 | 
			
		||||
    let chunk_service = gen_chunk_service(tmpdir.path());
 | 
			
		||||
| 
						 | 
				
			
			@ -268,6 +265,4 @@ fn test_complicated() -> anyhow::Result<()> {
 | 
			
		|||
            1, 0, 0, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 0 // ")"
 | 
			
		||||
        ]
 | 
			
		||||
    );
 | 
			
		||||
 | 
			
		||||
    Ok(())
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue