style: Address clippy

This commit is contained in:
Ed Page 2019-10-28 16:25:41 -06:00
parent 8a8007d353
commit dc327e0d51
3 changed files with 5 additions and 8 deletions

View file

@ -9,7 +9,7 @@ fn parse_dict(raw: &str) -> impl Iterator<Item = (&str, Vec<&str>)> {
let corrections = parts let corrections = parts
.next() .next()
.unwrap() .unwrap()
.split(",") .split(',')
.filter_map(|c| { .filter_map(|c| {
let c = c.trim(); let c = c.trim();
if c.is_empty() { if c.is_empty() {
@ -49,7 +49,6 @@ fn generate<W: std::io::Write>(file: &mut W) {
let codegenned = builder.build(); let codegenned = builder.build();
writeln!(file, "{}", codegenned).unwrap(); writeln!(file, "{}", codegenned).unwrap();
writeln!(file, ";").unwrap(); writeln!(file, ";").unwrap();
writeln!(file, "").unwrap();
} }
#[derive(Debug, StructOpt)] #[derive(Debug, StructOpt)]

View file

@ -31,7 +31,7 @@ fn parse_dict(
current = &mut american; current = &mut american;
} else if line.contains("DictBritish") { } else if line.contains("DictBritish") {
current = &mut british; current = &mut british;
} else if line.contains("}") { } else if line.contains('}') {
current = &mut bad; current = &mut bad;
} else { } else {
let captures = mapping.captures(line); let captures = mapping.captures(line);
@ -78,7 +78,7 @@ fn generate<W: std::io::Write>(file: &mut W) {
let codegenned = builder.build(); let codegenned = builder.build();
writeln!(file, "{}", codegenned).unwrap(); writeln!(file, "{}", codegenned).unwrap();
writeln!(file, ";").unwrap(); writeln!(file, ";").unwrap();
writeln!(file, "").unwrap(); writeln!(file).unwrap();
writeln!( writeln!(
file, file,
@ -94,7 +94,7 @@ fn generate<W: std::io::Write>(file: &mut W) {
let codegenned = builder.build(); let codegenned = builder.build();
writeln!(file, "{}", codegenned).unwrap(); writeln!(file, "{}", codegenned).unwrap();
writeln!(file, ";").unwrap(); writeln!(file, ";").unwrap();
writeln!(file, "").unwrap(); writeln!(file).unwrap();
writeln!( writeln!(
file, file,
@ -110,7 +110,6 @@ fn generate<W: std::io::Write>(file: &mut W) {
let codegenned = builder.build(); let codegenned = builder.build();
writeln!(file, "{}", codegenned).unwrap(); writeln!(file, "{}", codegenned).unwrap();
writeln!(file, ";").unwrap(); writeln!(file, ";").unwrap();
writeln!(file, "").unwrap();
} }
#[derive(Debug, StructOpt)] #[derive(Debug, StructOpt)]

View file

@ -9,7 +9,7 @@ fn parse_dict(raw: &str) -> impl Iterator<Item = (&str, Vec<&str>)> {
let corrections = parts let corrections = parts
.next() .next()
.unwrap() .unwrap()
.split(",") .split(',')
.filter_map(|c| { .filter_map(|c| {
let c = c.trim(); let c = c.trim();
if c.is_empty() { if c.is_empty() {
@ -49,7 +49,6 @@ fn generate<W: std::io::Write>(file: &mut W) {
let codegenned = builder.build(); let codegenned = builder.build();
writeln!(file, "{}", codegenned).unwrap(); writeln!(file, "{}", codegenned).unwrap();
writeln!(file, ";").unwrap(); writeln!(file, ";").unwrap();
writeln!(file, "").unwrap();
} }
#[derive(Debug, StructOpt)] #[derive(Debug, StructOpt)]