From ed67df90edee0608558aa3d427219b18563ed1be Mon Sep 17 00:00:00 2001 From: Aaron Siddhartha Mondal Date: Fri, 3 Nov 2023 15:32:37 +0100 Subject: [PATCH] Revert "Fix never looping loops (#372)" This reverts commit 755c10ef0c33e07a21fef7da692594745723a625. This doesn't work. --- cas/store/tests/filesystem_store_test.rs | 41 ++++++------------------ 1 file changed, 10 insertions(+), 31 deletions(-) diff --git a/cas/store/tests/filesystem_store_test.rs b/cas/store/tests/filesystem_store_test.rs index a7a2e808d..934f041a8 100644 --- a/cas/store/tests/filesystem_store_test.rs +++ b/cas/store/tests/filesystem_store_test.rs @@ -41,7 +41,7 @@ use traits::UploadSizeInfo; use buf_channel::{make_buf_channel_pair, DropCloserReadHalf}; use common::{fs, DigestInfo}; -use error::{make_input_err, Code, Error, ResultExt}; +use error::{Code, Error, ResultExt}; use filesystem_store::{digest_from_filename, EncodedFilePath, FileEntry, FileEntryImpl, FilesystemStore}; use traits::StoreTrait; @@ -308,16 +308,9 @@ mod filesystem_store_tests { .into_inner(); let mut read_dir_stream = ReadDirStream::new(temp_dir_handle); - while let Some(entry) = read_dir_stream.next().await { - match entry { - Ok(temp_dir_entry) => { - let path = temp_dir_entry.path(); - panic!("No files should exist in temp directory, found: {path:?}"); - } - Err(e) => { - return Err(make_input_err!("Couldn't read directory entry: {e:?}")); - } - } + while let Some(temp_dir_entry) = read_dir_stream.next().await { + let path = temp_dir_entry?.path(); + panic!("No files should exist in temp directory, found: {path:?}"); } Ok(()) @@ -417,16 +410,9 @@ mod filesystem_store_tests { .err_tip(|| "Failed opening temp directory")? .into_inner(); let mut read_dir_stream = ReadDirStream::new(temp_dir_handle); - while let Some(entry) = read_dir_stream.next().await { - match entry { - Ok(temp_dir_entry) => { - let path = temp_dir_entry.path(); - panic!("No files should exist in temp directory, found: {path:?}"); - } - Err(e) => { - return Err(make_input_err!("Couldn't read directory entry: {e:?}")); - } - } + while let Some(temp_dir_entry) = read_dir_stream.next().await { + let path = temp_dir_entry?.path(); + panic!("No files should exist in temp directory, found: {path:?}"); } } @@ -521,16 +507,9 @@ mod filesystem_store_tests { .err_tip(|| "Failed opening temp directory")? .into_inner(); let mut read_dir_stream = ReadDirStream::new(temp_dir_handle); - while let Some(entry) = read_dir_stream.next().await { - match entry { - Ok(temp_dir_entry) => { - let path = temp_dir_entry.path(); - panic!("No files should exist in temp directory, found: {path:?}"); - } - Err(e) => { - return Err(make_input_err!("Couldn't read directory entry: {e:?}")); - } - } + while let Some(temp_dir_entry) = read_dir_stream.next().await { + let path = temp_dir_entry?.path(); + panic!("No files should exist in temp directory, found: {:?}", path); } }