@@ -16,10 +16,7 @@ use anyhow::Error;
1616/// or plugin_macro. Plugin's transform fn itself does not allow to return
1717/// error - instead it should use provided `handler` to emit corresponding error
1818/// to the host.
19- #[ cfg_attr(
20- feature = "encoding-impl" ,
21- derive( crate :: Encode , crate :: Decode )
22- ) ]
19+ #[ cfg_attr( feature = "encoding-impl" , derive( crate :: Encode , crate :: Decode ) ) ]
2320pub enum PluginError {
2421 /// Occurs when failed to convert size passed from host / guest into usize
2522 /// or similar for the conversion. This is an internal error rasied via
@@ -90,7 +87,7 @@ impl PluginSerializedBytes {
9087 let mut buf = cbor4ii:: core:: utils:: BufWriter :: new ( Vec :: new ( ) ) ;
9188 t. 0 . encode ( & mut buf) ?;
9289 Ok ( PluginSerializedBytes {
93- field : buf. into_inner ( )
90+ field : buf. into_inner ( ) ,
9491 } )
9592 }
9693
@@ -199,10 +196,10 @@ where
199196 writer : & mut W ,
200197 ) -> Result < ( ) , cbor4ii:: core:: enc:: Error < W :: Error > > {
201198 use cbor4ii:: core:: types:: Tag ;
202-
199+
203200 match & self . 0 {
204201 Ok ( t) => Tag ( 1 , t) . encode ( writer) ,
205- Err ( t) => Tag ( 0 , t) . encode ( writer)
202+ Err ( t) => Tag ( 0 , t) . encode ( writer) ,
206203 }
207204 }
208205}
@@ -222,8 +219,8 @@ where
222219 0 => E :: decode ( reader) . map ( Result :: Err ) . map ( ResultValue ) ,
223220 1 => T :: decode ( reader) . map ( Result :: Ok ) . map ( ResultValue ) ,
224221 _ => Err ( cbor4ii:: core:: error:: DecodeError :: Mismatch {
225- name : & "ResultValue" ,
226- found : tag. to_le_bytes ( ) [ 0 ]
222+ name : & "ResultValue" ,
223+ found : tag. to_le_bytes ( ) [ 0 ] ,
227224 } ) ,
228225 }
229226 }
0 commit comments