From 9eb475ccb7f9aac8dfdfa8e4eef4cdce2f616a7b Mon Sep 17 00:00:00 2001 From: Mrmaxmeier Date: Tue, 16 Jul 2024 14:58:20 +0200 Subject: [PATCH] refactoring --- symbolic-debuginfo/src/dwarf.rs | 2 +- symbolic-symcache/src/lookup.rs | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/symbolic-debuginfo/src/dwarf.rs b/symbolic-debuginfo/src/dwarf.rs index 765ee858..8c35fe0a 100644 --- a/symbolic-debuginfo/src/dwarf.rs +++ b/symbolic-debuginfo/src/dwarf.rs @@ -1374,7 +1374,7 @@ impl<'data> DwarfDebugSession<'data> { let mut res = HashMap::new(); for (i, file) in self.files().enumerate() { if let Ok(file) = file { - if let Some(_contents) = file.source_str() { + if file.source_str().is_some() { res.insert(file.abs_path_str(), i); } } diff --git a/symbolic-symcache/src/lookup.rs b/symbolic-symcache/src/lookup.rs index e7635d75..9c1a4f4a 100644 --- a/symbolic-symcache/src/lookup.rs +++ b/symbolic-symcache/src/lookup.rs @@ -228,9 +228,8 @@ impl<'data> Iterator for Functions<'data> { } } - function.map(|f| { + function.inspect(|_f| { self.function_idx += 1; - f }) } } @@ -266,9 +265,8 @@ impl<'data> Iterator for Files<'data> { type Item = File<'data>; fn next(&mut self) -> Option { - self.cache.get_file(self.file_idx).map(|f| { + self.cache.get_file(self.file_idx).inspect(|_f| { self.file_idx += 1; - f }) } }