@@ -468,41 +468,41 @@ impl<'data> GenericJsonIterator<'data> {
468468}
469469
470470#[ cfg_attr( debug_assertions, derive( Debug ) ) ]
471- pub enum EitherString < ' a > {
471+ pub enum EitherString < ' a , ' py > {
472472 Cow ( Cow < ' a , str > ) ,
473- Py ( Bound < ' a , PyString > ) ,
473+ Py ( Bound < ' py , PyString > ) ,
474474}
475475
476- impl < ' a > EitherString < ' a > {
476+ impl < ' py > EitherString < ' _ , ' py > {
477477 pub fn as_cow ( & self ) -> ValResult < Cow < ' _ , str > > {
478478 match self {
479- Self :: Cow ( data) => Ok ( data . clone ( ) ) ,
479+ Self :: Cow ( data) => Ok ( Cow :: Borrowed ( data ) ) ,
480480 Self :: Py ( py_str) => Ok ( Cow :: Borrowed ( py_string_str ( py_str) ?) ) ,
481481 }
482482 }
483483
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 > {
485485 match self {
486486 Self :: Cow ( cow) => new_py_string ( py, cow. as_ref ( ) , cache_str) ,
487487 Self :: Py ( py_string) => py_string. clone ( ) ,
488488 }
489489 }
490490}
491491
492- impl < ' a > From < & ' a str > for EitherString < ' a > {
492+ impl < ' a > From < & ' a str > for EitherString < ' a , ' _ > {
493493 fn from ( data : & ' a str ) -> Self {
494494 Self :: Cow ( Cow :: Borrowed ( data) )
495495 }
496496}
497497
498- impl From < String > for EitherString < ' _ > {
498+ impl From < String > for EitherString < ' _ , ' _ > {
499499 fn from ( data : String ) -> Self {
500500 Self :: Cow ( Cow :: Owned ( data) )
501501 }
502502}
503503
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 {
506506 Self :: Py ( date)
507507 }
508508}
0 commit comments