@@ -468,41 +468,41 @@ impl<'data> GenericJsonIterator<'data> {
468
468
}
469
469
470
470
#[ cfg_attr( debug_assertions, derive( Debug ) ) ]
471
- pub enum EitherString < ' a > {
471
+ pub enum EitherString < ' a , ' py > {
472
472
Cow ( Cow < ' a , str > ) ,
473
- Py ( Bound < ' a , PyString > ) ,
473
+ Py ( Bound < ' py , PyString > ) ,
474
474
}
475
475
476
- impl < ' a > EitherString < ' a > {
476
+ impl < ' py > EitherString < ' _ , ' py > {
477
477
pub fn as_cow ( & self ) -> ValResult < Cow < ' _ , str > > {
478
478
match self {
479
- Self :: Cow ( data) => Ok ( data . clone ( ) ) ,
479
+ Self :: Cow ( data) => Ok ( Cow :: Borrowed ( data ) ) ,
480
480
Self :: Py ( py_str) => Ok ( Cow :: Borrowed ( py_string_str ( py_str) ?) ) ,
481
481
}
482
482
}
483
483
484
- pub fn as_py_string ( & ' a self , py : Python < ' a > , cache_str : StringCacheMode ) -> Bound < ' a , PyString > {
484
+ pub fn as_py_string ( & self , py : Python < ' py > , cache_str : StringCacheMode ) -> Bound < ' py , PyString > {
485
485
match self {
486
486
Self :: Cow ( cow) => new_py_string ( py, cow. as_ref ( ) , cache_str) ,
487
487
Self :: Py ( py_string) => py_string. clone ( ) ,
488
488
}
489
489
}
490
490
}
491
491
492
- impl < ' a > From < & ' a str > for EitherString < ' a > {
492
+ impl < ' a > From < & ' a str > for EitherString < ' a , ' _ > {
493
493
fn from ( data : & ' a str ) -> Self {
494
494
Self :: Cow ( Cow :: Borrowed ( data) )
495
495
}
496
496
}
497
497
498
- impl From < String > for EitherString < ' _ > {
498
+ impl From < String > for EitherString < ' _ , ' _ > {
499
499
fn from ( data : String ) -> Self {
500
500
Self :: Cow ( Cow :: Owned ( data) )
501
501
}
502
502
}
503
503
504
- impl < ' a > From < Bound < ' a , PyString > > for EitherString < ' a > {
505
- fn from ( date : Bound < ' a , PyString > ) -> Self {
504
+ impl < ' py > From < Bound < ' py , PyString > > for EitherString < ' _ , ' py > {
505
+ fn from ( date : Bound < ' py , PyString > ) -> Self {
506
506
Self :: Py ( date)
507
507
}
508
508
}
0 commit comments