aboutsummaryrefslogtreecommitdiff
path: root/crates/assists/src/handlers/flip_trait_bound.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/assists/src/handlers/flip_trait_bound.rs')
-rw-r--r--crates/assists/src/handlers/flip_trait_bound.rs20
1 files changed, 10 insertions, 10 deletions
diff --git a/crates/assists/src/handlers/flip_trait_bound.rs b/crates/assists/src/handlers/flip_trait_bound.rs
index 92ee42181..d419d263e 100644
--- a/crates/assists/src/handlers/flip_trait_bound.rs
+++ b/crates/assists/src/handlers/flip_trait_bound.rs
@@ -11,7 +11,7 @@ use crate::{AssistContext, AssistId, AssistKind, Assists};
11// Flips two trait bounds. 11// Flips two trait bounds.
12// 12//
13// ``` 13// ```
14// fn foo<T: Clone +<|> Copy>() { } 14// fn foo<T: Clone +$0 Copy>() { }
15// ``` 15// ```
16// -> 16// ->
17// ``` 17// ```
@@ -52,19 +52,19 @@ mod tests {
52 52
53 #[test] 53 #[test]
54 fn flip_trait_bound_assist_available() { 54 fn flip_trait_bound_assist_available() {
55 check_assist_target(flip_trait_bound, "struct S<T> where T: A <|>+ B + C { }", "+") 55 check_assist_target(flip_trait_bound, "struct S<T> where T: A $0+ B + C { }", "+")
56 } 56 }
57 57
58 #[test] 58 #[test]
59 fn flip_trait_bound_not_applicable_for_single_trait_bound() { 59 fn flip_trait_bound_not_applicable_for_single_trait_bound() {
60 check_assist_not_applicable(flip_trait_bound, "struct S<T> where T: <|>A { }") 60 check_assist_not_applicable(flip_trait_bound, "struct S<T> where T: $0A { }")
61 } 61 }
62 62
63 #[test] 63 #[test]
64 fn flip_trait_bound_works_for_struct() { 64 fn flip_trait_bound_works_for_struct() {
65 check_assist( 65 check_assist(
66 flip_trait_bound, 66 flip_trait_bound,
67 "struct S<T> where T: A <|>+ B { }", 67 "struct S<T> where T: A $0+ B { }",
68 "struct S<T> where T: B + A { }", 68 "struct S<T> where T: B + A { }",
69 ) 69 )
70 } 70 }
@@ -73,21 +73,21 @@ mod tests {
73 fn flip_trait_bound_works_for_trait_impl() { 73 fn flip_trait_bound_works_for_trait_impl() {
74 check_assist( 74 check_assist(
75 flip_trait_bound, 75 flip_trait_bound,
76 "impl X for S<T> where T: A +<|> B { }", 76 "impl X for S<T> where T: A +$0 B { }",
77 "impl X for S<T> where T: B + A { }", 77 "impl X for S<T> where T: B + A { }",
78 ) 78 )
79 } 79 }
80 80
81 #[test] 81 #[test]
82 fn flip_trait_bound_works_for_fn() { 82 fn flip_trait_bound_works_for_fn() {
83 check_assist(flip_trait_bound, "fn f<T: A <|>+ B>(t: T) { }", "fn f<T: B + A>(t: T) { }") 83 check_assist(flip_trait_bound, "fn f<T: A $0+ B>(t: T) { }", "fn f<T: B + A>(t: T) { }")
84 } 84 }
85 85
86 #[test] 86 #[test]
87 fn flip_trait_bound_works_for_fn_where_clause() { 87 fn flip_trait_bound_works_for_fn_where_clause() {
88 check_assist( 88 check_assist(
89 flip_trait_bound, 89 flip_trait_bound,
90 "fn f<T>(t: T) where T: A +<|> B { }", 90 "fn f<T>(t: T) where T: A +$0 B { }",
91 "fn f<T>(t: T) where T: B + A { }", 91 "fn f<T>(t: T) where T: B + A { }",
92 ) 92 )
93 } 93 }
@@ -96,7 +96,7 @@ mod tests {
96 fn flip_trait_bound_works_for_lifetime() { 96 fn flip_trait_bound_works_for_lifetime() {
97 check_assist( 97 check_assist(
98 flip_trait_bound, 98 flip_trait_bound,
99 "fn f<T>(t: T) where T: A <|>+ 'static { }", 99 "fn f<T>(t: T) where T: A $0+ 'static { }",
100 "fn f<T>(t: T) where T: 'static + A { }", 100 "fn f<T>(t: T) where T: 'static + A { }",
101 ) 101 )
102 } 102 }
@@ -105,7 +105,7 @@ mod tests {
105 fn flip_trait_bound_works_for_complex_bounds() { 105 fn flip_trait_bound_works_for_complex_bounds() {
106 check_assist( 106 check_assist(
107 flip_trait_bound, 107 flip_trait_bound,
108 "struct S<T> where T: A<T> <|>+ b_mod::B<T> + C<T> { }", 108 "struct S<T> where T: A<T> $0+ b_mod::B<T> + C<T> { }",
109 "struct S<T> where T: b_mod::B<T> + A<T> + C<T> { }", 109 "struct S<T> where T: b_mod::B<T> + A<T> + C<T> { }",
110 ) 110 )
111 } 111 }
@@ -114,7 +114,7 @@ mod tests {
114 fn flip_trait_bound_works_for_long_bounds() { 114 fn flip_trait_bound_works_for_long_bounds() {
115 check_assist( 115 check_assist(
116 flip_trait_bound, 116 flip_trait_bound,
117 "struct S<T> where T: A + B + C + D + E + F +<|> G + H + I + J { }", 117 "struct S<T> where T: A + B + C + D + E + F +$0 G + H + I + J { }",
118 "struct S<T> where T: A + B + C + D + E + G + F + H + I + J { }", 118 "struct S<T> where T: A + B + C + D + E + G + F + H + I + J { }",
119 ) 119 )
120 } 120 }