mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-14 14:13:58 +00:00
Fix test
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
This commit is contained in:
parent
b9ba9fab5a
commit
638abba05c
1 changed files with 5 additions and 1 deletions
|
@ -156,7 +156,7 @@ fn str_ref_to_string(
|
||||||
let edit = TextEdit::insert(expr.syntax().text_range().end(), to_string);
|
let edit = TextEdit::insert(expr.syntax().text_range().end(), to_string);
|
||||||
let source_change =
|
let source_change =
|
||||||
SourceChange::from_text_edit(d.expr.file_id.original_file(ctx.sema.db), edit);
|
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(())
|
Some(())
|
||||||
}
|
}
|
||||||
|
@ -530,11 +530,15 @@ fn foo() -> SomeOtherEnum { 0$0 }
|
||||||
fn str_ref_to_string() {
|
fn str_ref_to_string() {
|
||||||
check_fix(
|
check_fix(
|
||||||
r#"
|
r#"
|
||||||
|
struct String;
|
||||||
|
|
||||||
fn test() -> String {
|
fn test() -> String {
|
||||||
"a"$0
|
"a"$0
|
||||||
}
|
}
|
||||||
"#,
|
"#,
|
||||||
r#"
|
r#"
|
||||||
|
struct String;
|
||||||
|
|
||||||
fn test() -> String {
|
fn test() -> String {
|
||||||
"a".to_string()
|
"a".to_string()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue