style: Make clippy happy

This commit is contained in:
Ed Page 2021-11-08 11:28:34 -06:00
parent 9446008676
commit 05edccea2e

View file

@ -620,15 +620,14 @@ mod test {
fn fix_simple(line: &str, corrections: Vec<(usize, &'static str, &'static str)>) -> String { fn fix_simple(line: &str, corrections: Vec<(usize, &'static str, &'static str)>) -> String {
let line = line.as_bytes().to_vec(); let line = line.as_bytes().to_vec();
let corrections: Vec<_> = corrections let corrections = corrections
.into_iter() .into_iter()
.map(|(byte_offset, typo, correction)| typos::Typo { .map(|(byte_offset, typo, correction)| typos::Typo {
byte_offset, byte_offset,
typo: typo.into(), typo: typo.into(),
corrections: typos::Status::Corrections(vec![correction.into()]), corrections: typos::Status::Corrections(vec![correction.into()]),
}) });
.collect(); let actual = fix_buffer(line, corrections);
let actual = fix_buffer(line, corrections.into_iter());
String::from_utf8(actual).unwrap() String::from_utf8(actual).unwrap()
} }