From 4f8fec975b7d393f6de234c57043d6a23574dc5b Mon Sep 17 00:00:00 2001 From: Alpha Chen Date: Thu, 21 Apr 2016 08:52:39 -0700 Subject: [PATCH] Make stuff more Rust-y --- rust/src/day_08.rs | 1 + rust/src/day_09.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/rust/src/day_08.rs b/rust/src/day_08.rs index f64161e..73fa154 100644 --- a/rust/src/day_08.rs +++ b/rust/src/day_08.rs @@ -20,6 +20,7 @@ fn test_decode() { assert_eq!(1, decode(r#""\xfa""#).chars().count()); } +#[allow(dead_code)] fn decode(string: &str) -> String { let mut out = "".to_owned(); diff --git a/rust/src/day_09.rs b/rust/src/day_09.rs index 3d54922..ebddb1c 100644 --- a/rust/src/day_09.rs +++ b/rust/src/day_09.rs @@ -59,7 +59,7 @@ impl<'a> Day09<'a> { fn routes(&self) -> Vec { let mut locations = self.locations.iter() - .map(|l| l.clone()) + .cloned() .collect::>(); let heap = Heap::new(&mut locations); heap.map(|p| self.route(p)).collect()