]> git.lizzy.rs Git - rust.git/commitdiff
reduced the tests to their bare essence
authorJeroen Vannevel <jer_vannevel@outlook.com>
Tue, 4 Jan 2022 10:11:04 +0000 (10:11 +0000)
committerJeroen Vannevel <jer_vannevel@outlook.com>
Tue, 4 Jan 2022 10:11:04 +0000 (10:11 +0000)
crates/ide_assists/src/handlers/extract_function.rs

index 2821f6cde98abcda1017677133b4d7d71e994a8e..59c52dcd04a43f4a5743cf337004ef6f2b1f599a 100644 (file)
@@ -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);
 }
 "#,
         );