From b9af1d7c428bac3e2efb69e0dadda72938ce3b3c Mon Sep 17 00:00:00 2001 From: Alan Du Date: Mon, 3 Jun 2019 10:07:00 -0400 Subject: Fix clippy::match_ref_pats --- crates/ra_ide_api/src/line_index_utils.rs | 12 ++++++------ crates/ra_text_edit/src/test_utils.rs | 6 +++--- 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> { } fn next_steps(&mut self, step: &Step) -> NextSteps { - let step_pos = match step { - &Step::Newline(n) => n, - &Step::Utf16Char(r) => r.end(), + let step_pos = match *step { + Step::Newline(n) => n, + Step::Utf16Char(r) => r.end(), }; let res = match &mut self.current { Some(edit) => { @@ -181,9 +181,9 @@ impl<'a> Edits<'a> { if self.acc_diff == 0 { x.clone() } else { - match x { - &Step::Newline(n) => Step::Newline(self.translate(n)), - &Step::Utf16Char(r) => Step::Utf16Char(self.translate_range(r)), + match *x { + Step::Newline(n) => Step::Newline(self.translate(n)), + Step::Utf16Char(r) => Step::Utf16Char(self.translate_range(r)), } } } 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 { .prop_flat_map(|cuts| { let strategies: Vec<_> = cuts .chunks(2) - .map(|chunk| match chunk { - &[from, to] => { + .map(|chunk| match *chunk { + [from, to] => { let range = TextRange::from_to(from, to); Just(AtomTextEdit::delete(range)) .boxed() @@ -54,7 +54,7 @@ pub fn arb_text_edit(text: &str) -> BoxedStrategy { ) .boxed() } - &[x] => arb_text().prop_map(move |text| AtomTextEdit::insert(x, text)).boxed(), + [x] => arb_text().prop_map(move |text| AtomTextEdit::insert(x, text)).boxed(), _ => unreachable!(), }) .collect(); -- cgit v1.2.3