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() { fn main() {
match real_main() { if let Err(e) = real_main() {
Err(e) => eprintln!("ERROR: {}", e), eprintln!("ERROR: {}", e);
Ok(_) => {}
} }
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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