make Error enum variants clearer

This commit is contained in:
2024-12-31 08:42:28 +00:00
parent e3f6613c6d
commit 84ada5576f
5 changed files with 14 additions and 14 deletions
+4 -4
View File
@@ -17,7 +17,7 @@ impl ProcessSnapshot {
match CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0) {
Ok(snapshot) => snapshot,
Err(why) => {
return Err(crate::Error::SnapshotError(format!(
return Err(crate::Error::CreateSnapshotError(format!(
"failed to create process snapshot: {why}"
)))
}
@@ -31,7 +31,7 @@ impl ProcessSnapshot {
match Process32FirstW(snapshot, &mut process_entry_32_w) {
Ok(()) => {}
Err(why) => {
return Err(crate::Error::SnapshotError(format!(
return Err(crate::Error::CreateSnapshotError(format!(
"failed to get first process from snapshot: {why}"
)))
}
@@ -71,7 +71,7 @@ impl ModuleSnapshot {
match CreateToolhelp32Snapshot(TH32CS_SNAPMODULE | TH32CS_SNAPMODULE32, pid) {
Ok(snapshot) => snapshot,
Err(why) => {
return Err(crate::Error::SnapshotError(format!(
return Err(crate::Error::CreateSnapshotError(format!(
"failed to create module snapshot: {why}"
)))
}
@@ -85,7 +85,7 @@ impl ModuleSnapshot {
match Module32FirstW(snapshot, &mut module_entry_32_w) {
Ok(()) => {}
Err(why) => {
return Err(crate::Error::SnapshotError(format!(
return Err(crate::Error::CreateSnapshotError(format!(
"failed to get first module from snapshot: {why}"
)))
}