@@ -241,7 +241,7 @@ where
241241 . flatten ( )
242242 . context ( "variant case should have payload type" ) ?;
243243 let mut enc = self . with_type ( & payload_type) ;
244- enc. encode ( & payload_val. into_owned ( ) , dst)
244+ enc. encode ( & * payload_val, dst)
245245 . context ( "failed to encode variant payload" ) ?;
246246 }
247247 Ok ( ( ) )
@@ -293,7 +293,7 @@ where
293293 . option_some_type ( )
294294 . context ( "option type should have some type" ) ?;
295295 let mut enc = self . with_type ( & inner_type) ;
296- enc. encode ( & inner. into_owned ( ) , dst)
296+ enc. encode ( & * inner, dst)
297297 . context ( "failed to encode `option::some` value" ) ?;
298298 Ok ( ( ) )
299299 }
@@ -311,7 +311,7 @@ where
311311 dst. put_u8 ( 0 ) ;
312312 if let Some ( ok_ty) = ok_type {
313313 let mut enc = self . with_type ( & ok_ty) ;
314- enc. encode ( & val. into_owned ( ) , dst)
314+ enc. encode ( & * val, dst)
315315 . context ( "failed to encode `result::ok` value" ) ?;
316316 }
317317 }
@@ -329,7 +329,7 @@ where
329329 dst. put_u8 ( 1 ) ;
330330 if let Some ( err_ty) = err_type {
331331 let mut enc = self . with_type ( & err_ty) ;
332- enc. encode ( & val. into_owned ( ) , dst)
332+ enc. encode ( & * val, dst)
333333 . context ( "failed to encode `result::err` value" ) ?;
334334 }
335335 }
0 commit comments