style: Update clippy

This commit is contained in:
Ed Page 2022-03-29 15:01:51 -05:00
parent bf2c277951
commit 86c54fffbf
3 changed files with 4 additions and 4 deletions

View file

@ -20,7 +20,7 @@ fn parse_dict(raw: &str) -> Words {
let mut current = &mut bad;
for line in raw.lines() {
let line = line.splitn(2, "//").next().unwrap().trim();
let line = line.split_once("//").map(|l| l.0).unwrap_or(line).trim();
if line.is_empty() || line.starts_with("package") {
continue;
} else if line.contains("DictMain") {

View file

@ -47,7 +47,7 @@ pub struct Variant {
impl Variant {
pub fn into_owned(self) -> crate::Variant {
crate::Variant {
types: self.types.iter().copied().collect(),
types: self.types.to_vec(),
word: self.word.to_owned(),
}
}

View file

@ -131,7 +131,7 @@ impl Report for PrintLong {
fn print_brief_correction(msg: &Typo, palette: Palette) -> Result<(), std::io::Error> {
let line = String::from_utf8_lossy(msg.buffer.as_ref());
let line = line.replace("\t", " ");
let line = line.replace('\t', " ");
let column = unicode_segmentation::UnicodeSegmentation::graphemes(
line.get(0..msg.byte_offset).unwrap(),
true,
@ -177,7 +177,7 @@ fn print_long_correction(msg: &Typo, palette: Palette) -> Result<(), std::io::Er
let mut handle = stdout.lock();
let line = String::from_utf8_lossy(msg.buffer.as_ref());
let line = line.replace("\t", " ");
let line = line.replace('\t', " ");
let start = String::from_utf8_lossy(&msg.buffer[0..msg.byte_offset]);
let column = unicode_segmentation::UnicodeSegmentation::graphemes(start.as_ref(), true).count();
match &msg.corrections {