@@ -173,23 +173,23 @@ impl Data {
173173}
174174
175175impl Generic {
176- pub fn full ( & self ) -> String {
176+ pub fn full ( & self ) -> & str {
177177 match & self {
178- Generic :: Const { name, .. } => name. clone ( ) ,
179- Generic :: Regular { name, .. } => name. clone ( ) ,
180- Generic :: Lifetime { name, .. } => name. clone ( ) ,
181- Generic :: WhereBounded { name, .. } => name. clone ( ) ,
178+ Generic :: Const { name, .. } => name,
179+ Generic :: Regular { name, .. } => name,
180+ Generic :: Lifetime { name, .. } => name,
181+ Generic :: WhereBounded { name, .. } => name,
182182 }
183183 }
184184
185- fn lifetime_prefix ( & self ) -> & str {
185+ fn lifetime_prefix ( & self ) -> & ' static str {
186186 match & self {
187187 Generic :: Lifetime { .. } => "\' " ,
188188 _ => "" ,
189189 }
190190 }
191191
192- fn const_prefix ( & self ) -> & str {
192+ fn const_prefix ( & self ) -> & ' static str {
193193 match & self {
194194 Generic :: Const { .. } => "const " ,
195195 _ => "" ,
@@ -1421,7 +1421,7 @@ fn get_all_bounds<T: Iterator<Item = TokenTree> + Clone>(source: &mut Peekable<T
14211421 // let mut generic_bounds = Vec::new();
14221422 // let mut in_type = true;
14231423 while let Some ( gen) = next_generic ( source) {
1424- if already. insert ( gen. full ( ) ) {
1424+ if already. insert ( gen. full ( ) . to_owned ( ) ) {
14251425 ret. push ( gen) ;
14261426 } else {
14271427 match (
@@ -1453,7 +1453,7 @@ fn get_all_bounds<T: Iterator<Item = TokenTree> + Clone>(source: &mut Peekable<T
14531453 panic ! ( "mismatched generic types" )
14541454 }
14551455 }
1456- }
1456+ } ;
14571457 let Some ( _) = next_exact_punct ( source, "," ) else {
14581458 break ;
14591459 } ;
@@ -1470,7 +1470,7 @@ fn get_all_bounds<T: Iterator<Item = TokenTree> + Clone>(source: &mut Peekable<T
14701470 }
14711471
14721472 while let Some ( gen) = next_generic ( source) {
1473- if already. insert ( gen. full ( ) ) {
1473+ if already. insert ( gen. full ( ) . to_owned ( ) ) {
14741474 let gen = match gen {
14751475 Generic :: Regular { name, bounds, .. } => Generic :: WhereBounded { name, bounds } ,
14761476 where_bounded @ Generic :: WhereBounded { .. } => where_bounded,
0 commit comments