@@ -43,13 +43,13 @@ impl fmt::Display for SignatureError {
43
43
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
44
44
match self {
45
45
SignatureError :: FailedRetrievingSemanticData ( full_path) => {
46
- write ! ( f, "Failed retrieving semantic data for {:?}." , full_path )
46
+ write ! ( f, "Failed retrieving semantic data for {full_path :?}." )
47
47
}
48
48
SignatureError :: FailedWritingSignature ( full_path) => {
49
- write ! ( f, "Failed writing signature for {:?}." , full_path )
49
+ write ! ( f, "Failed writing signature for {full_path :?}." )
50
50
}
51
51
SignatureError :: FailedWritingType ( full_path) => {
52
- write ! ( f, "Failed writing a type for {:?}." , full_path )
52
+ write ! ( f, "Failed writing a type for {full_path :?}." )
53
53
}
54
54
}
55
55
}
@@ -460,7 +460,7 @@ impl HirDisplay for ConstantId {
460
460
)
461
461
} ,
462
462
) ?;
463
- write ! ( f, " // = {}" , value ) . map_err ( |_| {
463
+ write ! ( f, " // = {value}" ) . map_err ( |_| {
464
464
SignatureError :: FailedWritingSignature (
465
465
constant_full_signature. full_path . clone ( ) ,
466
466
)
@@ -769,7 +769,7 @@ fn extract_and_format(input: &str) -> String {
769
769
let mut slice_start = 0 ;
770
770
let mut in_slice = false ;
771
771
772
- for ( i, c) in input. chars ( ) . enumerate ( ) {
772
+ for ( i, c) in input. char_indices ( ) {
773
773
if delimiters. contains ( & c) {
774
774
if in_slice {
775
775
let slice = & input[ slice_start..i] ;
@@ -801,7 +801,7 @@ fn format_final_part(slice: &str) -> String {
801
801
_ => slice. to_string ( ) ,
802
802
}
803
803
} ;
804
- if ensure_whitespace && !result. starts_with ( ' ' ) { format ! ( " {}" , result ) } else { result }
804
+ if ensure_whitespace && !result. starts_with ( ' ' ) { format ! ( " {result}" ) } else { result }
805
805
}
806
806
807
807
/// Takes a list of [`GenericParamId`]s and formats it into a String representation used for
@@ -825,19 +825,15 @@ fn format_resolver_generic_params(db: &dyn DocGroup, params: Vec<GenericParamId>
825
825
GenericParam :: Impl ( generic_param_impl) => {
826
826
match generic_param_impl. concrete_trait {
827
827
Ok ( concrete_trait) => {
828
- let concrete_trait_name = concrete_trait. name( db) ;
829
- let concrete_trait_generic_args_formatted =
828
+ format!(
829
+ "impl {param_formatted}: {}<{}>" ,
830
+ concrete_trait. name( db) ,
830
831
concrete_trait
831
832
. generic_args( db)
832
833
. iter( )
833
834
. map( |arg| arg. format( db) )
834
835
. collect:: <Vec <_>>( )
835
- . join( ", " ) ;
836
- format!(
837
- "impl {}: {}<{}>" ,
838
- param_formatted,
839
- concrete_trait_name,
840
- concrete_trait_generic_args_formatted
836
+ . join( ", " ) ,
841
837
)
842
838
}
843
839
Err ( _) => param_formatted,
@@ -971,7 +967,7 @@ fn write_generic_params(
971
967
Some ( documentable_id) ,
972
968
) ?;
973
969
if !concrete_trait_generic_args_formatted. is_empty ( ) {
974
- write ! ( f, "<{}>" , concrete_trait_generic_args_formatted ) ?;
970
+ write ! ( f, "<{concrete_trait_generic_args_formatted }>" ) ?;
975
971
}
976
972
}
977
973
}
0 commit comments