From a62b11df3f8b4ff785e9d533c12c10ac246db26a Mon Sep 17 00:00:00 2001 From: futile Date: Thu, 4 Dec 2025 04:13:08 +0000 Subject: [PATCH] process: make searching for a module case-insensitive --- src/process.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/process.rs b/src/process.rs index 7ba00b0..a69b684 100644 --- a/src/process.rs +++ b/src/process.rs @@ -64,13 +64,11 @@ impl Process { Ok(process) } - /// get a `Module` of a `Process` by name - /// - /// note: the casing matters (don't search for `shell32.dll` if you want `SHELL32.dll`) + /// get a `Module` of a `Process` by name (case-insensitive) pub fn module(&self, name: &str) -> Result { let Some(snapshot) = snapshot::ModuleSnapshot::get_modules(self.id)? .into_iter() - .find(|snapshot| snapshot.name == name) + .find(|snapshot| name.eq_ignore_ascii_case(&snapshot.name)) else { return Err(Error::CreateProcessError(format!( "failed to find a module with identifier `{name}`",