1111//! usually be marker types and the associated types will also usually be
1212//! markers.
1313
14- use std:: borrow:: { Borrow , Cow } ;
14+ use std:: borrow:: Cow ;
1515
1616use serde:: { ser:: SerializeSeq , Deserialize , Deserializer , Serializer } ;
1717
@@ -75,11 +75,11 @@ pub trait IsScalar<SchemaType> {
7575
7676// TODO: serialize should maybe be on an InputScalar trait
7777// or maybe just ScalarSerialize/ScalarDeserialize? not sure...
78- pub trait IsOutputScalar < SchemaType > : Sized {
78+ pub trait IsOutputScalar < ' de , SchemaType > : Sized {
7979 /// The schema marker type this scalar represents.
8080 type SchemaType ;
8181
82- fn deserialize < ' de , D > ( deserializer : D ) -> Result < Self , D :: Error >
82+ fn deserialize < D > ( deserializer : D ) -> Result < Self , D :: Error >
8383 where
8484 D : Deserializer < ' de > ;
8585}
@@ -115,13 +115,13 @@ where
115115 }
116116}
117117
118- impl < T , U > IsOutputScalar < Option < T > > for Option < U >
118+ impl < ' de , T , U > IsOutputScalar < ' de , Option < T > > for Option < U >
119119where
120- U : IsOutputScalar < T > ,
120+ U : IsOutputScalar < ' de , T > ,
121121{
122122 type SchemaType = Option < U :: SchemaType > ;
123123
124- fn deserialize < ' de , D > ( deserializer : D ) -> Result < Self , D :: Error >
124+ fn deserialize < D > ( deserializer : D ) -> Result < Self , D :: Error >
125125 where
126126 D : Deserializer < ' de > ,
127127 {
@@ -150,13 +150,13 @@ where
150150 }
151151}
152152
153- impl < T , U > IsOutputScalar < Vec < T > > for Vec < U >
153+ impl < ' de , T , U > IsOutputScalar < ' de , Vec < T > > for Vec < U >
154154where
155- U : IsOutputScalar < T > ,
155+ U : IsOutputScalar < ' de , T > ,
156156{
157157 type SchemaType = Vec < U :: SchemaType > ;
158158
159- fn deserialize < ' de , D > ( deserializer : D ) -> Result < Self , D :: Error >
159+ fn deserialize < D > ( deserializer : D ) -> Result < Self , D :: Error >
160160 where
161161 D : Deserializer < ' de > ,
162162 {
@@ -217,13 +217,13 @@ where
217217 }
218218}
219219
220- impl < T , U : ?Sized > IsOutputScalar < Box < T > > for Box < U >
220+ impl < ' de , T , U : ?Sized > IsOutputScalar < ' de , Box < T > > for Box < U >
221221where
222- U : IsOutputScalar < T > ,
222+ U : IsOutputScalar < ' de , T > ,
223223{
224224 type SchemaType = Box < U :: SchemaType > ;
225225
226- fn deserialize < ' de , D > ( deserializer : D ) -> Result < Self , D :: Error >
226+ fn deserialize < D > ( deserializer : D ) -> Result < Self , D :: Error >
227227 where
228228 D : Deserializer < ' de > ,
229229 {
@@ -245,24 +245,24 @@ where
245245 }
246246}
247247
248- impl < T , U : ?Sized > IsOutputScalar < T > for std:: borrow:: Cow < ' _ , U >
248+ impl < ' de , T , U : ?Sized > IsOutputScalar < ' de , T > for std:: borrow:: Cow < ' _ , U >
249249where
250- U : IsOutputScalar < T > + ToOwned ,
250+ U : IsOutputScalar < ' de , T > + ToOwned ,
251251{
252252 type SchemaType = U :: SchemaType ;
253253
254- fn deserialize < ' de , D > ( deserializer : D ) -> Result < Self , D :: Error >
254+ fn deserialize < D > ( deserializer : D ) -> Result < Self , D :: Error >
255255 where
256256 D : Deserializer < ' de > ,
257257 {
258258 Ok ( Cow :: Owned ( U :: deserialize ( deserializer) ?. to_owned ( ) ) )
259259 }
260260}
261261
262- impl IsOutputScalar < String > for std:: borrow:: Cow < ' static , str > {
262+ impl < ' de > IsOutputScalar < ' de , String > for std:: borrow:: Cow < ' static , str > {
263263 type SchemaType = String ;
264264
265- fn deserialize < ' de , D > ( deserializer : D ) -> Result < Self , D :: Error >
265+ fn deserialize < D > ( deserializer : D ) -> Result < Self , D :: Error >
266266 where
267267 D : Deserializer < ' de > ,
268268 {
@@ -283,10 +283,10 @@ impl IsScalar<bool> for bool {
283283 }
284284}
285285
286- impl IsOutputScalar < bool > for bool {
286+ impl < ' de > IsOutputScalar < ' de , bool > for bool {
287287 type SchemaType = bool ;
288288
289- fn deserialize < ' de , D > ( deserializer : D ) -> Result < Self , D :: Error >
289+ fn deserialize < D > ( deserializer : D ) -> Result < Self , D :: Error >
290290 where
291291 D : Deserializer < ' de > ,
292292 {
@@ -305,10 +305,10 @@ impl IsScalar<String> for String {
305305 }
306306}
307307
308- impl IsOutputScalar < String > for String {
308+ impl < ' de > IsOutputScalar < ' de , String > for String {
309309 type SchemaType = String ;
310310
311- fn deserialize < ' de , D > ( deserializer : D ) -> Result < Self , D :: Error >
311+ fn deserialize < D > ( deserializer : D ) -> Result < Self , D :: Error >
312312 where
313313 D : Deserializer < ' de > ,
314314 {
@@ -338,10 +338,10 @@ impl IsScalar<i32> for i32 {
338338 }
339339}
340340
341- impl IsOutputScalar < i32 > for i32 {
341+ impl < ' de > IsOutputScalar < ' de , i32 > for i32 {
342342 type SchemaType = i32 ;
343343
344- fn deserialize < ' de , D > ( deserializer : D ) -> Result < Self , D :: Error >
344+ fn deserialize < D > ( deserializer : D ) -> Result < Self , D :: Error >
345345 where
346346 D : Deserializer < ' de > ,
347347 {
@@ -360,10 +360,10 @@ impl IsScalar<f64> for f64 {
360360 }
361361}
362362
363- impl IsOutputScalar < f64 > for f64 {
363+ impl < ' de > IsOutputScalar < ' de , f64 > for f64 {
364364 type SchemaType = f64 ;
365365
366- fn deserialize < ' de , D > ( deserializer : D ) -> Result < Self , D :: Error >
366+ fn deserialize < D > ( deserializer : D ) -> Result < Self , D :: Error >
367367 where
368368 D : Deserializer < ' de > ,
369369 {
@@ -382,10 +382,10 @@ impl IsScalar<crate::Id> for crate::Id {
382382 }
383383}
384384
385- impl IsOutputScalar < crate :: Id > for crate :: Id {
385+ impl < ' de > IsOutputScalar < ' de , crate :: Id > for crate :: Id {
386386 type SchemaType = crate :: Id ;
387387
388- fn deserialize < ' de , D > ( deserializer : D ) -> Result < Self , D :: Error >
388+ fn deserialize < D > ( deserializer : D ) -> Result < Self , D :: Error >
389389 where
390390 D : Deserializer < ' de > ,
391391 {
0 commit comments