Unnamed repository; edit this file 'description' to name the repository.
reduced the tests to their bare essence
Jeroen Vannevel 2022-01-04
parent 5beddf9 · commit ec61abb
-rw-r--r--crates/ide_assists/src/handlers/extract_function.rs18
1 files changed, 6 insertions, 12 deletions
diff --git a/crates/ide_assists/src/handlers/extract_function.rs b/crates/ide_assists/src/handlers/extract_function.rs
index 2821f6cde9..59c52dcd04 100644
--- a/crates/ide_assists/src/handlers/extract_function.rs
+++ b/crates/ide_assists/src/handlers/extract_function.rs
@@ -4346,11 +4346,9 @@ pub struct Foo {
}
pub fn testfn(arg: &mut Foo) {
- $0arg.field = 8; // write access
- println!("{}", arg.field); // read access$0
+ $0arg.field = 8;$0
// Simulating access after the extracted portion
- arg.field = 16; // write access
- println!("{}", arg.field); // read access
+ arg.field = 16;
}
"#,
r#"
@@ -4359,15 +4357,13 @@ pub struct Foo {
}
pub fn testfn(arg: &mut Foo) {
- fun_name(arg); // read access
+ fun_name(arg);
// Simulating access after the extracted portion
- arg.field = 16; // write access
- println!("{}", arg.field); // read access
+ arg.field = 16;
}
fn $0fun_name(arg: &mut Foo) {
arg.field = 8;
- println!("{}", arg.field);
}
"#,
);
@@ -4383,8 +4379,7 @@ pub struct Foo {
}
pub fn testfn(arg: &mut Foo) {
- $0arg.field = 8; // write access
- println!("{}", arg.field); // read access$0
+ $0arg.field = 8;$0
}
"#,
r#"
@@ -4393,12 +4388,11 @@ pub struct Foo {
}
pub fn testfn(arg: &mut Foo) {
- fun_name(arg); // read access
+ fun_name(arg);
}
fn $0fun_name(arg: &mut Foo) {
arg.field = 8;
- println!("{}", arg.field);
}
"#,
);