@@ -390,18 +390,17 @@ impl Diagnostic {
390390 expected : DiagnosticStyledString ,
391391 found : DiagnosticStyledString ,
392392 ) -> & 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 ) ] ;
395394 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 ) ,
398397 } ) ) ;
399- msg. push ( ( "` to type '" . to_string ( ) , Style :: NoStyle ) ) ;
398+ msg. push ( ( "` to type '" , Style :: NoStyle ) ) ;
400399 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 ) ,
403402 } ) ) ;
404- msg. push ( ( "`" . to_string ( ) , Style :: NoStyle ) ) ;
403+ msg. push ( ( "`" , Style :: NoStyle ) ) ;
405404
406405 // For now, just attach these as notes
407406 self . highlighted_note ( msg) ;
0 commit comments