From 1dbd53a3472d9b9725a310f64a2930e0c3c0ac3d Mon Sep 17 00:00:00 2001 From: futile Date: Mon, 30 Dec 2024 19:38:37 +0000 Subject: [PATCH] some changes --- src/process/mod.rs | 1 + src/process/process.rs | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/process/mod.rs b/src/process/mod.rs index 328d625..5149f82 100644 --- a/src/process/mod.rs +++ b/src/process/mod.rs @@ -1,4 +1,5 @@ #![allow(clippy::module_inception)] +#![allow(clippy::module_name_repetitions)] mod handle; mod memory; diff --git a/src/process/process.rs b/src/process/process.rs index 6705321..586681c 100644 --- a/src/process/process.rs +++ b/src/process/process.rs @@ -21,15 +21,14 @@ pub enum Identifier { impl Process { pub fn from(identifier: &Identifier) -> Result { - let snapshot = match identifier { + let Some(snapshot) = (match identifier { Identifier::Id(pid) => ProcessSnapshot::get_processes()? .into_iter() .find(|snapshot| snapshot.id == *pid), Identifier::Name(ref name) => ProcessSnapshot::get_processes()? .into_iter() .find(|snapshot| snapshot.name == *name), - }; - let Some(snapshot) = snapshot else { + }) else { return Err(crate::Error::ProcessError(format!( "failed to find a process with identifier `{identifier}`", )));