diff options
author | Aleksey Kladov <[email protected]> | 2020-05-20 11:59:20 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-05-20 12:02:53 +0100 |
commit | ecac5d7de2192873c24b7b06d4964d188d8abe6a (patch) | |
tree | f916c9d90a5b1817db4aed2c60db2ce4809dab1f /crates/ra_assists/src/handlers/inline_local_variable.rs | |
parent | 5258c817f78ecdfe12d7eec44ab3169134cba71d (diff) |
Switch to new magic marks
Diffstat (limited to 'crates/ra_assists/src/handlers/inline_local_variable.rs')
-rw-r--r-- | crates/ra_assists/src/handlers/inline_local_variable.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/crates/ra_assists/src/handlers/inline_local_variable.rs b/crates/ra_assists/src/handlers/inline_local_variable.rs index 5b26814d3..46d675a4e 100644 --- a/crates/ra_assists/src/handlers/inline_local_variable.rs +++ b/crates/ra_assists/src/handlers/inline_local_variable.rs | |||
@@ -3,7 +3,7 @@ use ra_syntax::{ | |||
3 | ast::{self, AstNode, AstToken}, | 3 | ast::{self, AstNode, AstToken}, |
4 | TextRange, | 4 | TextRange, |
5 | }; | 5 | }; |
6 | use test_utils::tested_by; | 6 | use test_utils::mark; |
7 | 7 | ||
8 | use crate::{ | 8 | use crate::{ |
9 | assist_context::{AssistContext, Assists}, | 9 | assist_context::{AssistContext, Assists}, |
@@ -33,11 +33,11 @@ pub(crate) fn inline_local_variable(acc: &mut Assists, ctx: &AssistContext) -> O | |||
33 | _ => return None, | 33 | _ => return None, |
34 | }; | 34 | }; |
35 | if bind_pat.mut_token().is_some() { | 35 | if bind_pat.mut_token().is_some() { |
36 | tested_by!(test_not_inline_mut_variable); | 36 | mark::hit!(test_not_inline_mut_variable); |
37 | return None; | 37 | return None; |
38 | } | 38 | } |
39 | if !bind_pat.syntax().text_range().contains_inclusive(ctx.offset()) { | 39 | if !bind_pat.syntax().text_range().contains_inclusive(ctx.offset()) { |
40 | tested_by!(not_applicable_outside_of_bind_pat); | 40 | mark::hit!(not_applicable_outside_of_bind_pat); |
41 | return None; | 41 | return None; |
42 | } | 42 | } |
43 | let initializer_expr = let_stmt.initializer()?; | 43 | let initializer_expr = let_stmt.initializer()?; |
@@ -46,7 +46,7 @@ pub(crate) fn inline_local_variable(acc: &mut Assists, ctx: &AssistContext) -> O | |||
46 | let def = Definition::Local(def); | 46 | let def = Definition::Local(def); |
47 | let refs = def.find_usages(ctx.db, None); | 47 | let refs = def.find_usages(ctx.db, None); |
48 | if refs.is_empty() { | 48 | if refs.is_empty() { |
49 | tested_by!(test_not_applicable_if_variable_unused); | 49 | mark::hit!(test_not_applicable_if_variable_unused); |
50 | return None; | 50 | return None; |
51 | }; | 51 | }; |
52 | 52 | ||
@@ -122,7 +122,7 @@ pub(crate) fn inline_local_variable(acc: &mut Assists, ctx: &AssistContext) -> O | |||
122 | 122 | ||
123 | #[cfg(test)] | 123 | #[cfg(test)] |
124 | mod tests { | 124 | mod tests { |
125 | use test_utils::covers; | 125 | use test_utils::mark; |
126 | 126 | ||
127 | use crate::tests::{check_assist, check_assist_not_applicable}; | 127 | use crate::tests::{check_assist, check_assist_not_applicable}; |
128 | 128 | ||
@@ -330,7 +330,7 @@ fn foo() { | |||
330 | 330 | ||
331 | #[test] | 331 | #[test] |
332 | fn test_not_inline_mut_variable() { | 332 | fn test_not_inline_mut_variable() { |
333 | covers!(test_not_inline_mut_variable); | 333 | mark::check!(test_not_inline_mut_variable); |
334 | check_assist_not_applicable( | 334 | check_assist_not_applicable( |
335 | inline_local_variable, | 335 | inline_local_variable, |
336 | r" | 336 | r" |
@@ -663,7 +663,7 @@ fn foo() { | |||
663 | 663 | ||
664 | #[test] | 664 | #[test] |
665 | fn test_not_applicable_if_variable_unused() { | 665 | fn test_not_applicable_if_variable_unused() { |
666 | covers!(test_not_applicable_if_variable_unused); | 666 | mark::check!(test_not_applicable_if_variable_unused); |
667 | check_assist_not_applicable( | 667 | check_assist_not_applicable( |
668 | inline_local_variable, | 668 | inline_local_variable, |
669 | r" | 669 | r" |
@@ -676,7 +676,7 @@ fn foo() { | |||
676 | 676 | ||
677 | #[test] | 677 | #[test] |
678 | fn not_applicable_outside_of_bind_pat() { | 678 | fn not_applicable_outside_of_bind_pat() { |
679 | covers!(not_applicable_outside_of_bind_pat); | 679 | mark::check!(not_applicable_outside_of_bind_pat); |
680 | check_assist_not_applicable( | 680 | check_assist_not_applicable( |
681 | inline_local_variable, | 681 | inline_local_variable, |
682 | r" | 682 | r" |