@@ -122,9 +122,9 @@ impl<'a, W: Write> ser::Serializer for &'a mut Serializer<W> {
122
122
}
123
123
124
124
#[ inline]
125
- fn serialize_some < T : ? Sized > ( self , value : & T ) -> Result < Self :: Ok , Self :: Error >
125
+ fn serialize_some < T > ( self , value : & T ) -> Result < Self :: Ok , Self :: Error >
126
126
where
127
- T : Serialize ,
127
+ T : ? Sized + Serialize ,
128
128
{
129
129
value. serialize ( self )
130
130
}
@@ -152,13 +152,13 @@ impl<'a, W: Write> ser::Serializer for &'a mut Serializer<W> {
152
152
self . writer . write_all ( & [ v] ) . map_err ( Error :: from)
153
153
}
154
154
155
- fn serialize_newtype_struct < T : ? Sized > (
155
+ fn serialize_newtype_struct < T > (
156
156
self ,
157
157
name : & ' static str ,
158
158
value : & T ,
159
159
) -> Result < Self :: Ok , Self :: Error >
160
160
where
161
- T : Serialize ,
161
+ T : ? Sized + Serialize ,
162
162
{
163
163
if name == crate :: raw:: TOKEN {
164
164
value. serialize ( RawMessageSerializer ( & mut self . writer ) )
@@ -167,15 +167,15 @@ impl<'a, W: Write> ser::Serializer for &'a mut Serializer<W> {
167
167
}
168
168
}
169
169
170
- fn serialize_newtype_variant < T : ? Sized > (
170
+ fn serialize_newtype_variant < T > (
171
171
self ,
172
172
name : & ' static str ,
173
173
_variant_index : u32 ,
174
174
variant : & ' static str ,
175
175
value : & T ,
176
176
) -> Result < Self :: Ok , Self :: Error >
177
177
where
178
- T : Serialize ,
178
+ T : ? Sized + Serialize ,
179
179
{
180
180
let v: u8 = variant
181
181
. parse ( )
@@ -257,9 +257,9 @@ impl<'a, W: Write> ser::Serializer for &'a mut Serializer<W> {
257
257
}
258
258
259
259
#[ inline]
260
- fn collect_str < T : ? Sized > ( self , value : & T ) -> Result < Self :: Ok , Self :: Error >
260
+ fn collect_str < T > ( self , value : & T ) -> Result < Self :: Ok , Self :: Error >
261
261
where
262
- T : Display ,
262
+ T : ? Sized + Display ,
263
263
{
264
264
self . serialize_str ( & value. to_string ( ) )
265
265
}
@@ -275,9 +275,9 @@ impl<'a, W: Write> ser::SerializeSeq for &'a mut Serializer<W> {
275
275
type Error = Error ;
276
276
277
277
#[ inline]
278
- fn serialize_element < T : ? Sized > ( & mut self , value : & T ) -> Result < ( ) , Self :: Error >
278
+ fn serialize_element < T > ( & mut self , value : & T ) -> Result < ( ) , Self :: Error >
279
279
where
280
- T : Serialize ,
280
+ T : ? Sized + Serialize ,
281
281
{
282
282
value. serialize ( & mut * * self )
283
283
}
@@ -293,9 +293,9 @@ impl<'a, W: Write> ser::SerializeTuple for &'a mut Serializer<W> {
293
293
type Error = Error ;
294
294
295
295
#[ inline]
296
- fn serialize_element < T : ? Sized > ( & mut self , value : & T ) -> Result < ( ) , Self :: Error >
296
+ fn serialize_element < T > ( & mut self , value : & T ) -> Result < ( ) , Self :: Error >
297
297
where
298
- T : Serialize ,
298
+ T : ? Sized + Serialize ,
299
299
{
300
300
value. serialize ( & mut * * self )
301
301
}
@@ -311,9 +311,9 @@ impl<'a, W: Write> ser::SerializeTupleStruct for &'a mut Serializer<W> {
311
311
type Error = Error ;
312
312
313
313
#[ inline]
314
- fn serialize_field < T : ? Sized > ( & mut self , value : & T ) -> Result < ( ) , Self :: Error >
314
+ fn serialize_field < T > ( & mut self , value : & T ) -> Result < ( ) , Self :: Error >
315
315
where
316
- T : Serialize ,
316
+ T : ? Sized + Serialize ,
317
317
{
318
318
value. serialize ( & mut * * self )
319
319
}
@@ -329,9 +329,9 @@ impl<'a, W: Write> ser::SerializeTupleVariant for &'a mut Serializer<W> {
329
329
type Error = Error ;
330
330
331
331
#[ inline]
332
- fn serialize_field < T : ? Sized > ( & mut self , value : & T ) -> Result < ( ) , Self :: Error >
332
+ fn serialize_field < T > ( & mut self , value : & T ) -> Result < ( ) , Self :: Error >
333
333
where
334
- T : Serialize ,
334
+ T : ? Sized + Serialize ,
335
335
{
336
336
value. serialize ( & mut * * self )
337
337
}
@@ -347,13 +347,9 @@ impl<'a, W: Write> ser::SerializeStruct for &'a mut Serializer<W> {
347
347
type Error = Error ;
348
348
349
349
#[ inline]
350
- fn serialize_field < T : ?Sized > (
351
- & mut self ,
352
- _key : & ' static str ,
353
- value : & T ,
354
- ) -> Result < ( ) , Self :: Error >
350
+ fn serialize_field < T > ( & mut self , _key : & ' static str , value : & T ) -> Result < ( ) , Self :: Error >
355
351
where
356
- T : Serialize ,
352
+ T : ? Sized + Serialize ,
357
353
{
358
354
value. serialize ( & mut * * self )
359
355
}
@@ -369,13 +365,9 @@ impl<'a, W: Write> ser::SerializeStructVariant for &'a mut Serializer<W> {
369
365
type Error = Error ;
370
366
371
367
#[ inline]
372
- fn serialize_field < T : ?Sized > (
373
- & mut self ,
374
- _key : & ' static str ,
375
- value : & T ,
376
- ) -> Result < ( ) , Self :: Error >
368
+ fn serialize_field < T > ( & mut self , _key : & ' static str , value : & T ) -> Result < ( ) , Self :: Error >
377
369
where
378
- T : Serialize ,
370
+ T : ? Sized + Serialize ,
379
371
{
380
372
value. serialize ( & mut * * self )
381
373
}
@@ -391,29 +383,25 @@ impl<'a, W: Write> ser::SerializeMap for &'a mut Serializer<W> {
391
383
type Error = Error ;
392
384
393
385
#[ inline]
394
- fn serialize_key < T : ? Sized > ( & mut self , key : & T ) -> Result < ( ) , Self :: Error >
386
+ fn serialize_key < T > ( & mut self , key : & T ) -> Result < ( ) , Self :: Error >
395
387
where
396
- T : Serialize ,
388
+ T : ? Sized + Serialize ,
397
389
{
398
390
key. serialize ( & mut * * self )
399
391
}
400
392
401
393
#[ inline]
402
- fn serialize_value < T : ? Sized > ( & mut self , value : & T ) -> Result < ( ) , Self :: Error >
394
+ fn serialize_value < T > ( & mut self , value : & T ) -> Result < ( ) , Self :: Error >
403
395
where
404
- T : Serialize ,
396
+ T : ? Sized + Serialize ,
405
397
{
406
398
value. serialize ( & mut * * self )
407
399
}
408
400
409
- fn serialize_entry < K : ?Sized , V : ?Sized > (
410
- & mut self ,
411
- key : & K ,
412
- value : & V ,
413
- ) -> Result < ( ) , Self :: Error >
401
+ fn serialize_entry < K , V > ( & mut self , key : & K , value : & V ) -> Result < ( ) , Self :: Error >
414
402
where
415
- K : Serialize ,
416
- V : Serialize ,
403
+ K : ? Sized + Serialize ,
404
+ V : ? Sized + Serialize ,
417
405
{
418
406
self . serialize_key ( key) ?;
419
407
self . serialize_value ( value)
@@ -508,9 +496,9 @@ impl<W: Write> ser::Serializer for RawMessageSerializer<W> {
508
496
Err ( ser:: Error :: custom ( "expected RawMessage" ) )
509
497
}
510
498
511
- fn serialize_some < T : ? Sized > ( self , _value : & T ) -> Result < Self :: Ok , Self :: Error >
499
+ fn serialize_some < T > ( self , _value : & T ) -> Result < Self :: Ok , Self :: Error >
512
500
where
513
- T : Serialize ,
501
+ T : ? Sized + Serialize ,
514
502
{
515
503
Err ( ser:: Error :: custom ( "expected RawMessage" ) )
516
504
}
@@ -532,26 +520,26 @@ impl<W: Write> ser::Serializer for RawMessageSerializer<W> {
532
520
Err ( ser:: Error :: custom ( "expected RawMessage" ) )
533
521
}
534
522
535
- fn serialize_newtype_struct < T : ? Sized > (
523
+ fn serialize_newtype_struct < T > (
536
524
self ,
537
525
_name : & ' static str ,
538
526
_value : & T ,
539
527
) -> Result < Self :: Ok , Self :: Error >
540
528
where
541
- T : Serialize ,
529
+ T : ? Sized + Serialize ,
542
530
{
543
531
Err ( ser:: Error :: custom ( "expected RawMessage" ) )
544
532
}
545
533
546
- fn serialize_newtype_variant < T : ? Sized > (
534
+ fn serialize_newtype_variant < T > (
547
535
self ,
548
536
_name : & ' static str ,
549
537
_variant_index : u32 ,
550
538
_variant : & ' static str ,
551
539
_value : & T ,
552
540
) -> Result < Self :: Ok , Self :: Error >
553
541
where
554
- T : Serialize ,
542
+ T : ? Sized + Serialize ,
555
543
{
556
544
Err ( ser:: Error :: custom ( "expected RawMessage" ) )
557
545
}
0 commit comments