diff --git a/exercises/24_file_io/file_io3.rs b/exercises/24_file_io/file_io3.rs index 51df5a82..0f25c03d 100644 --- a/exercises/24_file_io/file_io3.rs +++ b/exercises/24_file_io/file_io3.rs @@ -67,12 +67,12 @@ fn file_cleanup() -> Result<(), std::io::Error> { })?; } - if let Some(dir_path) = path_buffer.parent() { - if dir_path.exists() { - fs::remove_dir(dir_path).inspect(|_| { - println!("Test dir removed"); - })?; - } + if let Some(dir_path) = path_buffer.parent() + && dir_path.exists() + { + fs::remove_dir(dir_path).inspect(|_| { + println!("Test dir removed"); + })?; } Ok(()) diff --git a/solutions/24_file_io/file_io3.rs b/solutions/24_file_io/file_io3.rs index d2b20432..c6a05d4e 100644 --- a/solutions/24_file_io/file_io3.rs +++ b/solutions/24_file_io/file_io3.rs @@ -66,12 +66,12 @@ fn file_cleanup() -> Result<(), std::io::Error> { })?; } - if let Some(dir_path) = path_buffer.parent() { - if dir_path.exists() { - fs::remove_dir(dir_path).inspect(|_| { - println!("Test dir removed"); - })?; - } + if let Some(dir_path) = path_buffer.parent() + && dir_path.exists() + { + fs::remove_dir(dir_path).inspect(|_| { + println!("Test dir removed"); + })?; } Ok(())