From ec61abbe930ae07b2a89813e37d595de1d47b288 Mon Sep 17 00:00:00 2001 From: Jeroen Vannevel Date: Tue, 4 Jan 2022 10:11:04 +0000 Subject: [PATCH] reduced the tests to their bare essence --- .../src/handlers/extract_function.rs | 18 ++++++------------ 1 file 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 2821f6cde98..59c52dcd04a 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); } "#, ); -- 2.44.0