File tree 2 files changed +5
-7
lines changed
compiler/rustc_builtin_macros/src
2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -711,11 +711,9 @@ fn report_missing_placeholders(
711
711
} ;
712
712
713
713
let pos = sub. position( ) ;
714
- let sub = String :: from( sub. as_str( ) ) ;
715
- if explained. contains( & sub) {
714
+ if !explained. insert( sub. as_string( ) ) {
716
715
continue ;
717
716
}
718
- explained. insert( sub) ;
719
717
720
718
if !found_foreign {
721
719
found_foreign = true ;
Original file line number Diff line number Diff line change @@ -13,10 +13,10 @@ pub(crate) mod printf {
13
13
}
14
14
15
15
impl < ' a > Substitution < ' a > {
16
- pub ( crate ) fn as_str ( & self ) -> & str {
16
+ pub ( crate ) fn as_string ( & self ) -> String {
17
17
match self {
18
- Substitution :: Format ( fmt) => fmt. span ,
19
- Substitution :: Escape ( _) => "%%" ,
18
+ Substitution :: Format ( fmt) => fmt. span . into ( ) ,
19
+ Substitution :: Escape ( _) => "%%" . into ( ) ,
20
20
}
21
21
}
22
22
@@ -628,7 +628,7 @@ pub(crate) mod shell {
628
628
}
629
629
630
630
impl Substitution < ' _ > {
631
- pub ( crate ) fn as_str ( & self ) -> String {
631
+ pub ( crate ) fn as_string ( & self ) -> String {
632
632
match self {
633
633
Substitution :: Ordinal ( n, _) => format ! ( "${n}" ) ,
634
634
Substitution :: Name ( n, _) => format ! ( "${n}" ) ,
You can’t perform that action at this time.
0 commit comments