@@ -390,18 +390,17 @@ impl Diagnostic {
390
390
expected : DiagnosticStyledString ,
391
391
found : DiagnosticStyledString ,
392
392
) -> & mut Self {
393
- let mut msg: Vec < _ > =
394
- vec ! [ ( "required when trying to coerce from type `" . to_string( ) , Style :: NoStyle ) ] ;
393
+ let mut msg: Vec < _ > = vec ! [ ( "required when trying to coerce from type `" , Style :: NoStyle ) ] ;
395
394
msg. extend ( expected. 0 . iter ( ) . map ( |x| match * x {
396
- StringPart :: Normal ( ref s) => ( s. to_owned ( ) , Style :: NoStyle ) ,
397
- StringPart :: Highlighted ( ref s) => ( s. to_owned ( ) , Style :: Highlight ) ,
395
+ StringPart :: Normal ( ref s) => ( s. as_str ( ) , Style :: NoStyle ) ,
396
+ StringPart :: Highlighted ( ref s) => ( s. as_str ( ) , Style :: Highlight ) ,
398
397
} ) ) ;
399
- msg. push ( ( "` to type '" . to_string ( ) , Style :: NoStyle ) ) ;
398
+ msg. push ( ( "` to type '" , Style :: NoStyle ) ) ;
400
399
msg. extend ( found. 0 . iter ( ) . map ( |x| match * x {
401
- StringPart :: Normal ( ref s) => ( s. to_owned ( ) , Style :: NoStyle ) ,
402
- StringPart :: Highlighted ( ref s) => ( s. to_owned ( ) , Style :: Highlight ) ,
400
+ StringPart :: Normal ( ref s) => ( s. as_str ( ) , Style :: NoStyle ) ,
401
+ StringPart :: Highlighted ( ref s) => ( s. as_str ( ) , Style :: Highlight ) ,
403
402
} ) ) ;
404
- msg. push ( ( "`" . to_string ( ) , Style :: NoStyle ) ) ;
403
+ msg. push ( ( "`" , Style :: NoStyle ) ) ;
405
404
406
405
// For now, just attach these as notes
407
406
self . highlighted_note ( msg) ;
0 commit comments