File tree 1 file changed +6
-10
lines changed
1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -99,16 +99,12 @@ pub enum RestoreStateError {
99
99
100
100
/// Error type for [`Vm::restore_state`]
101
101
#[ cfg( target_arch = "aarch64" ) ]
102
- #[ derive( Debug , derive_more:: From ) ]
103
- pub struct RestoreStateError ( crate :: arch:: aarch64:: gic:: Error ) ;
104
- #[ cfg( target_arch = "aarch64" ) ]
105
- impl std:: fmt:: Display for RestoreStateError {
106
- fn fmt ( & self , f : & mut std:: fmt:: Formatter ) -> std:: fmt:: Result {
107
- write ! ( f, "{}" , self . 0 )
108
- }
102
+ #[ derive( Debug , thiserror:: Error ) ]
103
+ pub enum RestoreStateError {
104
+ /// GIC Error
105
+ #[ error( "{0}" ) ]
106
+ GicError ( crate :: arch:: aarch64:: gic:: Error ) ,
109
107
}
110
- #[ cfg( target_arch = "aarch64" ) ]
111
- impl std:: error:: Error for RestoreStateError { }
112
108
113
109
pub type Result < T > = result:: Result < T , Error > ;
114
110
@@ -236,7 +232,7 @@ impl Vm {
236
232
) -> std:: result:: Result < ( ) , RestoreStateError > {
237
233
self . get_irqchip ( )
238
234
. restore_device ( mpidrs, & state. gic )
239
- . map_err ( RestoreStateError )
235
+ . map_err ( RestoreStateError :: GicError )
240
236
}
241
237
}
242
238
You can’t perform that action at this time.
0 commit comments