Clippy fixes

This commit is contained in:
Arne Keller 2019-04-04 15:21:56 +02:00
parent ab943ab747
commit 9f547de769
2 changed files with 4 additions and 6 deletions

View File

@ -42,8 +42,8 @@ fn read_stdin() -> InputData {
(0..corner_count) (0..corner_count)
.map(|idx| { .map(|idx| {
( (
(numbers[idx * 2 + 1] as f32).into(), numbers[idx * 2 + 1] as f32,
(numbers[idx * 2 + 2] as f32).into(), numbers[idx * 2 + 2] as f32,
) )
}) })
.collect::<Vec<_>>() .collect::<Vec<_>>()
@ -57,7 +57,7 @@ fn read_stdin() -> InputData {
.unwrap() .unwrap()
.trim() .trim()
.split(' ') .split(' ')
.map(|x| x.parse::<f32>().unwrap().into()) .map(|x| x.parse::<f32>().unwrap())
.collect::<Vec<_>>(); .collect::<Vec<_>>();
InputData { InputData {

View File

@ -298,9 +298,7 @@ lazy_static! {
fn none_intersect(mut line: Line) -> bool { fn none_intersect(mut line: Line) -> bool {
// Linie normalisieren // Linie normalisieren
if line.start.y > line.end.y || (line.start.y == line.end.y && line.start.x > line.end.x) { if line.start.y > line.end.y || (line.start.y == line.end.y && line.start.x > line.end.x) {
let end = line.start; std::mem::swap(&mut line.start, &mut line.end);
line.start = line.end;
line.end = end;
} }
// Cache laden // Cache laden
let mut collisions = COLLISIONS.write().unwrap(); let mut collisions = COLLISIONS.write().unwrap();