File tree Expand file tree Collapse file tree 3 files changed +6
-15
lines changed
Expand file tree Collapse file tree 3 files changed +6
-15
lines changed Original file line number Diff line number Diff line change 11use std:: collections:: HashMap ;
22
3- use n0_error:: { StdResultExt , e, stack_error} ;
3+ use n0_error:: { e, stack_error} ;
44use serde:: Deserialize ;
55use tracing:: warn;
66use 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]
1919pub 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" ) ]
Original file line number Diff line number Diff line change @@ -2,12 +2,9 @@ use tokio::sync::mpsc;
22
33use super :: actor:: NetworkMessage ;
44
5- #[ derive( Debug , derive_more:: Display ) ]
6- #[ display( "error" ) ]
5+ #[ derive( n0_error:: Error ) ]
76pub struct Error ;
87
9- impl std:: error:: Error for Error { }
10-
118#[ derive( Debug ) ]
129pub ( super ) struct RouteMonitor {
1310 _sender : mpsc:: Sender < NetworkMessage > ,
Original file line number Diff line number Diff 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]
2424pub 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}
You can’t perform that action at this time.
0 commit comments