Fix clippy::match_ref_pats

This commit is contained in:
Alan Du 2019-06-03 10:07:00 -04:00
parent dddcb0ad94
commit b9af1d7c42
2 changed files with 9 additions and 9 deletions

View File

@ -133,9 +133,9 @@ impl<'a> Edits<'a> {
} }
fn next_steps(&mut self, step: &Step) -> NextSteps { fn next_steps(&mut self, step: &Step) -> NextSteps {
let step_pos = match step { let step_pos = match *step {
&Step::Newline(n) => n, Step::Newline(n) => n,
&Step::Utf16Char(r) => r.end(), Step::Utf16Char(r) => r.end(),
}; };
let res = match &mut self.current { let res = match &mut self.current {
Some(edit) => { Some(edit) => {
@ -181,9 +181,9 @@ impl<'a> Edits<'a> {
if self.acc_diff == 0 { if self.acc_diff == 0 {
x.clone() x.clone()
} else { } else {
match x { match *x {
&Step::Newline(n) => Step::Newline(self.translate(n)), Step::Newline(n) => Step::Newline(self.translate(n)),
&Step::Utf16Char(r) => Step::Utf16Char(self.translate_range(r)), Step::Utf16Char(r) => Step::Utf16Char(self.translate_range(r)),
} }
} }
} }

View File

@ -42,8 +42,8 @@ pub fn arb_text_edit(text: &str) -> BoxedStrategy<TextEdit> {
.prop_flat_map(|cuts| { .prop_flat_map(|cuts| {
let strategies: Vec<_> = cuts let strategies: Vec<_> = cuts
.chunks(2) .chunks(2)
.map(|chunk| match chunk { .map(|chunk| match *chunk {
&[from, to] => { [from, to] => {
let range = TextRange::from_to(from, to); let range = TextRange::from_to(from, to);
Just(AtomTextEdit::delete(range)) Just(AtomTextEdit::delete(range))
.boxed() .boxed()
@ -54,7 +54,7 @@ pub fn arb_text_edit(text: &str) -> BoxedStrategy<TextEdit> {
) )
.boxed() .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!(), _ => unreachable!(),
}) })
.collect(); .collect();