rename CreateProcessError to ProcessError

This commit is contained in:
2025-12-04 04:15:16 +00:00
parent a62b11df3f
commit 868ad9c191
2 changed files with 5 additions and 5 deletions
+3 -3
View File
@@ -9,12 +9,12 @@ pub enum Error {
/// there was a failure when reading or writing the process's memory /// there was a failure when reading or writing the process's memory
#[error("failed to access process memory")] #[error("failed to access process memory")]
AccessMemoryError(String), AccessMemoryError(String),
/// there was a failure in building the Process or Module struct
#[error("failed to create process")]
CreateProcessError(String),
/// there was a failure in creating a snapshot of processes or modules /// there was a failure in creating a snapshot of processes or modules
#[error("failed to create snapshot")] #[error("failed to create snapshot")]
CreateSnapshotError(String), CreateSnapshotError(String),
/// there was a failure in building the Process or Module struct
#[error("failed to get process/module")]
ProcessError(String),
/// there was a failure in conversion between integers /// there was a failure in conversion between integers
#[error("failed to convert integer")] #[error("failed to convert integer")]
ConvertIntegerError(#[from] std::num::TryFromIntError), ConvertIntegerError(#[from] std::num::TryFromIntError),
+2 -2
View File
@@ -50,7 +50,7 @@ impl Process {
Identifier::Name(ref name) => snapshot.name == *name, Identifier::Name(ref name) => snapshot.name == *name,
}) })
.ok_or_else(|| { .ok_or_else(|| {
Error::CreateProcessError(format!( Error::ProcessError(format!(
"failed to find a process with identifier `{identifier}`", "failed to find a process with identifier `{identifier}`",
)) ))
})?; })?;
@@ -70,7 +70,7 @@ impl Process {
.into_iter() .into_iter()
.find(|snapshot| name.eq_ignore_ascii_case(&snapshot.name)) .find(|snapshot| name.eq_ignore_ascii_case(&snapshot.name))
else { else {
return Err(Error::CreateProcessError(format!( return Err(Error::ProcessError(format!(
"failed to find a module with identifier `{name}`", "failed to find a module with identifier `{name}`",
))); )));
}; };