Make stuff more Rust-y

wip
Alpha Chen 9 years ago
parent 721c1fe622
commit 4f8fec975b

@ -20,6 +20,7 @@ fn test_decode() {
assert_eq!(1, decode(r#""\xfa""#).chars().count()); assert_eq!(1, decode(r#""\xfa""#).chars().count());
} }
#[allow(dead_code)]
fn decode(string: &str) -> String { fn decode(string: &str) -> String {
let mut out = "".to_owned(); let mut out = "".to_owned();

@ -59,7 +59,7 @@ impl<'a> Day09<'a> {
fn routes(&self) -> Vec<Route> { fn routes(&self) -> Vec<Route> {
let mut locations = self.locations.iter() let mut locations = self.locations.iter()
.map(|l| l.clone()) .cloned()
.collect::<Vec<Location>>(); .collect::<Vec<Location>>();
let heap = Heap::new(&mut locations); let heap = Heap::new(&mut locations);
heap.map(|p| self.route(p)).collect() heap.map(|p| self.route(p)).collect()

Loading…
Cancel
Save