From d733c9bdad81e23959b1a43421a9fa6ea92eda9f Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 16 Mar 2021 22:28:04 +0300 Subject: Move more bounds changelog: skip --- crates/ide_assists/src/handlers/move_bounds.rs | 36 +++++++------------------- 1 file changed, 10 insertions(+), 26 deletions(-) (limited to 'crates/ide_assists/src/handlers/move_bounds.rs') diff --git a/crates/ide_assists/src/handlers/move_bounds.rs b/crates/ide_assists/src/handlers/move_bounds.rs index 48efa67ed..9ad0c9816 100644 --- a/crates/ide_assists/src/handlers/move_bounds.rs +++ b/crates/ide_assists/src/handlers/move_bounds.rs @@ -40,9 +40,9 @@ pub(crate) fn move_bounds_to_where_clause(acc: &mut Assists, ctx: &AssistContext let where_clause: ast::WhereClause = match_ast! { match parent { ast::Fn(it) => it.get_or_create_where_clause(), - // ast::Trait(it) => it.get_or_create_where_clause(), + ast::Trait(it) => it.get_or_create_where_clause(), ast::Impl(it) => it.get_or_create_where_clause(), - // ast::Enum(it) => it.get_or_create_where_clause(), + ast::Enum(it) => it.get_or_create_where_clause(), ast::Struct(it) => it.get_or_create_where_clause(), _ => return, } @@ -82,12 +82,8 @@ mod tests { fn move_bounds_to_where_clause_fn() { check_assist( move_bounds_to_where_clause, - r#" - fn foo T>() {} - "#, - r#" - fn foo() where T: u32, F: FnOnce(T) -> T {} - "#, + r#"fn foo T>() {}"#, + r#"fn foo() where T: u32, F: FnOnce(T) -> T {}"#, ); } @@ -95,12 +91,8 @@ mod tests { fn move_bounds_to_where_clause_impl() { check_assist( move_bounds_to_where_clause, - r#" - impl A {} - "#, - r#" - impl A where U: u32 {} - "#, + r#"impl A {}"#, + r#"impl A where U: u32 {}"#, ); } @@ -108,12 +100,8 @@ mod tests { fn move_bounds_to_where_clause_struct() { check_assist( move_bounds_to_where_clause, - r#" - struct A<$0T: Iterator> {} - "#, - r#" - struct A where T: Iterator {} - "#, + r#"struct A<$0T: Iterator> {}"#, + r#"struct A where T: Iterator {}"#, ); } @@ -121,12 +109,8 @@ mod tests { fn move_bounds_to_where_clause_tuple_struct() { check_assist( move_bounds_to_where_clause, - r#" - struct Pair<$0T: u32>(T, T); - "#, - r#" - struct Pair(T, T) where T: u32; - "#, + r#"struct Pair<$0T: u32>(T, T);"#, + r#"struct Pair(T, T) where T: u32;"#, ); } } -- cgit v1.2.3