From 9f547de769c46f2eb2c57e996bbf7b8587e6be38 Mon Sep 17 00:00:00 2001 From: Arne Keller Date: Thu, 4 Apr 2019 15:21:56 +0200 Subject: [PATCH] Clippy fixes --- src/input.rs | 6 +++--- src/main.rs | 4 +--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/input.rs b/src/input.rs index 4aefe5b..d819871 100644 --- a/src/input.rs +++ b/src/input.rs @@ -42,8 +42,8 @@ fn read_stdin() -> InputData { (0..corner_count) .map(|idx| { ( - (numbers[idx * 2 + 1] as f32).into(), - (numbers[idx * 2 + 2] as f32).into(), + numbers[idx * 2 + 1] as f32, + numbers[idx * 2 + 2] as f32, ) }) .collect::>() @@ -57,7 +57,7 @@ fn read_stdin() -> InputData { .unwrap() .trim() .split(' ') - .map(|x| x.parse::().unwrap().into()) + .map(|x| x.parse::().unwrap()) .collect::>(); InputData { diff --git a/src/main.rs b/src/main.rs index 3623041..d099a7a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -298,9 +298,7 @@ lazy_static! { fn none_intersect(mut line: Line) -> bool { // Linie normalisieren if line.start.y > line.end.y || (line.start.y == line.end.y && line.start.x > line.end.x) { - let end = line.start; - line.start = line.end; - line.end = end; + std::mem::swap(&mut line.start, &mut line.end); } // Cache laden let mut collisions = COLLISIONS.write().unwrap();