From 638abba05cbd8488bd62547ad8f6c1131615f7e9 Mon Sep 17 00:00:00 2001 From: hi-rustin Date: Sat, 9 Jul 2022 11:39:38 +0800 Subject: [PATCH] Fix test Signed-off-by: hi-rustin --- crates/ide-diagnostics/src/handlers/type_mismatch.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/ide-diagnostics/src/handlers/type_mismatch.rs b/crates/ide-diagnostics/src/handlers/type_mismatch.rs index 500a18ffb6..2239382472 100644 --- a/crates/ide-diagnostics/src/handlers/type_mismatch.rs +++ b/crates/ide-diagnostics/src/handlers/type_mismatch.rs @@ -156,7 +156,7 @@ fn str_ref_to_string( let edit = TextEdit::insert(expr.syntax().text_range().end(), to_string); let source_change = SourceChange::from_text_edit(d.expr.file_id.original_file(ctx.sema.db), edit); - acc.push(fix("str_ref_to_string", "Use to_string() here", source_change, expr_range)); + acc.push(fix("str_ref_to_string", "Add .to_string() here", source_change, expr_range)); Some(()) } @@ -530,11 +530,15 @@ fn foo() -> SomeOtherEnum { 0$0 } fn str_ref_to_string() { check_fix( r#" +struct String; + fn test() -> String { "a"$0 } "#, r#" +struct String; + fn test() -> String { "a".to_string() }