From 626e00bb562ba4a81f43b44f47bba2001cd3d05f Mon Sep 17 00:00:00 2001 From: Gwilym Kuiper Date: Mon, 18 Oct 2021 20:22:55 +0100 Subject: [PATCH] Can avoid needing .ok() --- agb-sound-converter/src/lib.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/agb-sound-converter/src/lib.rs b/agb-sound-converter/src/lib.rs index fe68264d..d2c4fb1c 100644 --- a/agb-sound-converter/src/lib.rs +++ b/agb-sound-converter/src/lib.rs @@ -28,15 +28,11 @@ pub fn include_wav(input: TokenStream) -> TokenStream { let out_file_path = Path::new(&out_dir).with_file_name(&out_filename); - let out_file_mtime = fs::metadata(&out_file_path) - .and_then(|metadata| metadata.modified()) - .ok(); - let in_file_mtime = fs::metadata(&path) - .and_then(|metadata| metadata.modified()) - .ok(); + let out_file_mtime = fs::metadata(&out_file_path).and_then(|metadata| metadata.modified()); + let in_file_mtime = fs::metadata(&path).and_then(|metadata| metadata.modified()); let should_write = match (out_file_mtime, in_file_mtime) { - (Some(out_file_mtime), Some(in_file_mtime)) => out_file_mtime <= in_file_mtime, + (Ok(out_file_mtime), Ok(in_file_mtime)) => out_file_mtime <= in_file_mtime, _ => true, };