File tree 3 files changed +15
-2
lines changed
3 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -285,7 +285,7 @@ where
285
285
286
286
impl < ' cow , T > Decode for Cow < ' cow , T >
287
287
where
288
- T : ToOwned ,
288
+ T : ToOwned + ? Sized ,
289
289
<T as ToOwned >:: Owned : Decode ,
290
290
{
291
291
fn decode < D : Decoder > ( decoder : & mut D ) -> Result < Self , DecodeError > {
@@ -296,7 +296,8 @@ where
296
296
297
297
impl < ' cow , T > Encode for Cow < ' cow , T >
298
298
where
299
- T : Encode + Clone ,
299
+ T : ToOwned + ?Sized ,
300
+ for < ' a > & ' a T : Encode ,
300
301
{
301
302
fn encode < E : Encoder > ( & self , encoder : & mut E ) -> Result < ( ) , EncodeError > {
302
303
self . as_ref ( ) . encode ( encoder)
Original file line number Diff line number Diff line change @@ -20,3 +20,6 @@ mod issue_498;
20
20
21
21
#[ path = "issues/issue_500.rs" ]
22
22
mod issue_500;
23
+
24
+ #[ path = "issues/issue_523.rs" ]
25
+ mod issue_523;
Original file line number Diff line number Diff line change
1
+ #![ cfg( all( feature = "derive" , feature = "std" ) ) ]
2
+
3
+ extern crate std;
4
+
5
+ use bincode:: { Decode , Encode } ;
6
+ use std:: borrow:: Cow ;
7
+
8
+ #[ derive( Clone , Encode , Decode ) ]
9
+ pub struct Foo < ' a > ( Cow < ' a , str > ) ;
You can’t perform that action at this time.
0 commit comments