From 731e6dd243cd0f7c849f9ac12a9da3edcd3b6c9e Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Thu, 2 Dec 2021 15:03:55 -0500 Subject: [PATCH] Fix some clippy warnings --- src/components.rs | 9 +++------ src/map_builders/simple_map.rs | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/components.rs b/src/components.rs index 9c833b9..c3c836c 100644 --- a/src/components.rs +++ b/src/components.rs @@ -23,12 +23,9 @@ impl From for Position { } } -impl Into for Position { - fn into(self) -> Point { - Point { - x: self.x, - y: self.y, - } +impl From for Point { + fn from(p: Position) -> Self { + Point { x: p.x, y: p.y } } } diff --git a/src/map_builders/simple_map.rs b/src/map_builders/simple_map.rs index f4bfbf1..374ac07 100644 --- a/src/map_builders/simple_map.rs +++ b/src/map_builders/simple_map.rs @@ -28,7 +28,7 @@ impl MapBuilder for SimpleMapBuilder { } fn get_starting_position(&self) -> Position { - self.starting_position.clone() + self.starting_position } fn get_snapshot_history(&self) -> Vec {