Skip to content

Commit cacf535

Browse files
committed
fixup
1 parent a4de394 commit cacf535

File tree

3 files changed

+6
-15
lines changed

3 files changed

+6
-15
lines changed

netwatch/src/interfaces/windows.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::collections::HashMap;
22

3-
use n0_error::{StdResultExt, e, stack_error};
3+
use n0_error::{e, stack_error};
44
use serde::Deserialize;
55
use tracing::warn;
66
use wmi::{COMLibrary, FilterValue, WMIConnection};
@@ -14,15 +14,12 @@ struct Win32_IP4RouteTable {
1414
Name: String,
1515
}
1616

17-
#[stack_error(derive, add_meta)]
17+
#[stack_error(derive, add_meta, std_sources)]
1818
#[non_exhaustive]
1919
pub enum Error {
2020
#[allow(dead_code)] // not sure why we have this here?
2121
#[error(transparent)]
22-
Io {
23-
#[error(std_err)]
24-
source: std::io::Error,
25-
},
22+
Io { source: std::io::Error },
2623
#[error("not route found")]
2724
NoRoute {},
2825
#[error("WMI")]

netwatch/src/netmon/android.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,9 @@ use tokio::sync::mpsc;
22

33
use super::actor::NetworkMessage;
44

5-
#[derive(Debug, derive_more::Display)]
6-
#[display("error")]
5+
#[derive(n0_error::Error)]
76
pub struct Error;
87

9-
impl std::error::Error for Error {}
10-
118
#[derive(Debug)]
129
pub(super) struct RouteMonitor {
1310
_sender: mpsc::Sender<NetworkMessage>,

netwatch/src/netmon/windows.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,11 @@ pub(super) struct RouteMonitor {
1919
cb_handler: CallbackHandler,
2020
}
2121

22-
#[stack_error(derive, add_meta)]
22+
#[stack_error(derive, add_meta, std_sources)]
2323
#[non_exhaustive]
2424
pub enum Error {
2525
#[error(transparent)]
26-
Io {
27-
#[error(std_err)]
28-
source: std::io::Error,
29-
},
26+
Io { source: std::io::Error },
3027
#[error("win32")]
3128
Win32 { source: windows_result::Error },
3229
}

0 commit comments

Comments
 (0)