From 3df1c4e52bfe6d11be3a9e61cad1acbbab9ec1ff Mon Sep 17 00:00:00 2001 From: Vivianne Langdon Date: Sat, 10 Dec 2022 11:58:42 -0800 Subject: [PATCH] Slightly cleaner --- src/bin/p07.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bin/p07.rs b/src/bin/p07.rs index 1f2731e..7ee9e65 100644 --- a/src/bin/p07.rs +++ b/src/bin/p07.rs @@ -168,8 +168,8 @@ impl State { } fn process_result(&mut self, res: Listing) { - let filename = clean(&self.cur_path.join(res.path()).to_string_lossy()); - if let Listing::File(_, size) = res { + if let Listing::File(path, size) = res { + let filename = clean(&self.cur_path.join(path).to_string_lossy()); self.filesystem.insert(filename, size); } }