From bc3f71838f76b9ec141e1012f49e2a24d067c3c8 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Thu, 16 Feb 2023 17:38:10 +0100 Subject: 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 Tested-by: BuildkiteCI --- tvix/store/src/tests/nar_renderer.rs | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/tvix/store/src/tests/nar_renderer.rs b/tvix/store/src/tests/nar_renderer.rs index 43afdefbf930..e19dd88777ae 100644 --- a/tvix/store/src/tests/nar_renderer.rs +++ b/tvix/store/src/tests/nar_renderer.rs @@ -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(()) } -- cgit 1.4.1