From 0b2c48990b40827a14d1914bcc76b26de592308c Mon Sep 17 00:00:00 2001 From: Alpha Chen Date: Sat, 16 Jan 2016 17:26:04 -0800 Subject: [PATCH] [rust] Box up the light grid --- rust/src/day_06.rs | 3 ++- rust/src/lib.rs | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/rust/src/day_06.rs b/rust/src/day_06.rs index d8fbd6d..8c9fa59 100644 --- a/rust/src/day_06.rs +++ b/rust/src/day_06.rs @@ -36,7 +36,7 @@ struct LightGrid { impl LightGrid { fn new() -> LightGrid { - LightGrid { grid: Box::new([false; 1_000 * 1_000]) } + LightGrid { grid: box [false; 1_000 * 1_000] } } fn turn_on(&mut self, rect: Rect) { @@ -148,6 +148,7 @@ impl<'a> Iterator for LightGridIterator<'a> { } } +#[derive(Debug)] struct Instruction { instruction: String, rect: Rect, diff --git a/rust/src/lib.rs b/rust/src/lib.rs index 249280e..0b7055b 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -1,3 +1,5 @@ +#![feature(box_syntax)] + extern crate crypto; extern crate regex;