aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Du <[email protected]>2019-06-03 15:07:00 +0100
committerAlan Du <[email protected]>2019-06-04 23:05:07 +0100
commitb9af1d7c428bac3e2efb69e0dadda72938ce3b3c (patch)
treefb5144f91b879904f363a383b24ce38f0b5166a1
parentdddcb0ad940a8010bb5df3d44526729d8e705213 (diff)
Fix clippy::match_ref_pats
-rw-r--r--crates/ra_ide_api/src/line_index_utils.rs12
-rw-r--r--crates/ra_text_edit/src/test_utils.rs6
2 files changed, 9 insertions, 9 deletions
diff --git a/crates/ra_ide_api/src/line_index_utils.rs b/crates/ra_ide_api/src/line_index_utils.rs
index 799a920ad..a03467011 100644
--- a/crates/ra_ide_api/src/line_index_utils.rs
+++ b/crates/ra_ide_api/src/line_index_utils.rs
@@ -133,9 +133,9 @@ impl<'a> Edits<'a> {
133 } 133 }
134 134
135 fn next_steps(&mut self, step: &Step) -> NextSteps { 135 fn next_steps(&mut self, step: &Step) -> NextSteps {
136 let step_pos = match step { 136 let step_pos = match *step {
137 &Step::Newline(n) => n, 137 Step::Newline(n) => n,
138 &Step::Utf16Char(r) => r.end(), 138 Step::Utf16Char(r) => r.end(),
139 }; 139 };
140 let res = match &mut self.current { 140 let res = match &mut self.current {
141 Some(edit) => { 141 Some(edit) => {
@@ -181,9 +181,9 @@ impl<'a> Edits<'a> {
181 if self.acc_diff == 0 { 181 if self.acc_diff == 0 {
182 x.clone() 182 x.clone()
183 } else { 183 } else {
184 match x { 184 match *x {
185 &Step::Newline(n) => Step::Newline(self.translate(n)), 185 Step::Newline(n) => Step::Newline(self.translate(n)),
186 &Step::Utf16Char(r) => Step::Utf16Char(self.translate_range(r)), 186 Step::Utf16Char(r) => Step::Utf16Char(self.translate_range(r)),
187 } 187 }
188 } 188 }
189 } 189 }
diff --git a/crates/ra_text_edit/src/test_utils.rs b/crates/ra_text_edit/src/test_utils.rs
index 9e21b24f6..2dc0e71af 100644
--- a/crates/ra_text_edit/src/test_utils.rs
+++ b/crates/ra_text_edit/src/test_utils.rs
@@ -42,8 +42,8 @@ pub fn arb_text_edit(text: &str) -> BoxedStrategy<TextEdit> {
42 .prop_flat_map(|cuts| { 42 .prop_flat_map(|cuts| {
43 let strategies: Vec<_> = cuts 43 let strategies: Vec<_> = cuts
44 .chunks(2) 44 .chunks(2)
45 .map(|chunk| match chunk { 45 .map(|chunk| match *chunk {
46 &[from, to] => { 46 [from, to] => {
47 let range = TextRange::from_to(from, to); 47 let range = TextRange::from_to(from, to);
48 Just(AtomTextEdit::delete(range)) 48 Just(AtomTextEdit::delete(range))
49 .boxed() 49 .boxed()
@@ -54,7 +54,7 @@ pub fn arb_text_edit(text: &str) -> BoxedStrategy<TextEdit> {
54 ) 54 )
55 .boxed() 55 .boxed()
56 } 56 }
57 &[x] => arb_text().prop_map(move |text| AtomTextEdit::insert(x, text)).boxed(), 57 [x] => arb_text().prop_map(move |text| AtomTextEdit::insert(x, text)).boxed(),
58 _ => unreachable!(), 58 _ => unreachable!(),
59 }) 59 })
60 .collect(); 60 .collect();