diff --git a/src/lib.rs b/src/lib.rs index 361e81e..e7d6da6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -109,7 +109,7 @@ impl State { pub fn set_active_plugins>(&mut self, active_plugins: &[T]) { self.active_plugins = active_plugins - .into_iter() + .iter() .map(|s| s.as_ref().to_lowercase()) .collect(); } diff --git a/src/version.rs b/src/version.rs index 5802e7b..56d8974 100644 --- a/src/version.rs +++ b/src/version.rs @@ -42,7 +42,7 @@ impl Version { f.dwFileVersion.Build ) }) - .unwrap_or(String::new()) + .unwrap_or_else(String::new) }) } @@ -50,7 +50,7 @@ impl Version { Self::read_version(file_path, |v| { v.query_value(&"ProductVersion") .map(String::from_utf16_lossy) - .unwrap_or(String::new()) + .unwrap_or_else(String::new) }) } @@ -99,7 +99,7 @@ fn get_pe_resources(bytes: &[u8]) -> Result { PeFile::from_bytes(bytes)?.resources() } - Err(e) => Err(e.into()), + Err(e) => Err(e), } }