Learn a bit from clippy.

This commit is contained in:
2020-12-07 19:49:14 -08:00
parent 8604b925ee
commit 8c79964316
7 changed files with 12 additions and 20 deletions

View File

@@ -121,8 +121,7 @@ fn next_target(low_index: usize, high_index: usize, avoid: &[usize]) -> Option<u
}
fn main() {
match real_main() {
Err(e) => eprintln!("ERROR: {}", e),
Ok(_) => {}
if let Err(e) = real_main() {
eprintln!("ERROR: {}", e);
}
}

View File

@@ -150,8 +150,7 @@ fn real_main() -> Result<(), TopLevelError> {
}
fn main() {
match real_main() {
Err(e) => eprintln!("ERROR: {}", e),
Ok(_) => {}
if let Err(e) = real_main() {
eprintln!("ERROR: {}", e);
}
}

View File

@@ -172,8 +172,7 @@ fn real_main() -> Result<(), TopLevelError> {
}
fn main() {
match real_main() {
Err(e) => eprintln!("ERROR: {}", e),
Ok(_) => {}
if let Err(e) = real_main() {
eprintln!("ERROR: {}", e);
}
}

View File

@@ -99,8 +99,7 @@ fn real_main() -> Result<(), TopLevelError> {
}
fn main() {
match real_main() {
Err(e) => eprintln!("ERROR: {}", e),
Ok(_) => {}
if let Err(e) = real_main() {
eprintln!("ERROR: {}", e);
}
}

View File

@@ -93,8 +93,7 @@ fn real_main() -> Result<(), TopLevelError> {
}
fn main() {
match real_main() {
Err(e) => eprintln!("ERROR: {}", e),
Ok(_) => {}
if let Err(e) = real_main() {
eprintln!("ERROR: {}", e);
}
}

View File

@@ -1,4 +1,3 @@
use nom;
use std::fmt;
use std::io;
use std::num::ParseIntError;

View File

@@ -30,11 +30,9 @@ where
_height += 1;
if width == 0 {
width = current_line.len();
} else {
if width != current_line.len() {
} else if width != current_line.len() {
return Err(E::from(MapParseError::UnevenLines(_height)));
}
}
data.push(current_line);
}