aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar alecdwm 2018-12-04 00:50:18 +1000
committerGravatar alecdwm 2018-12-04 00:50:18 +1000
commit1e3e5761590a88a1a98b0273fe79a45ff1c55889 (patch)
tree85101f0d8d0132a4863ab6db0eb64e034be7a8c7
parentac4199d6dc5b233f9cff54e393f435d386e43bf3 (diff)
removed unnecessary loop from day3 part1 solution
-rw-r--r--src/day3.rs9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/day3.rs b/src/day3.rs
index caea0f8..8161c86 100644
--- a/src/day3.rs
+++ b/src/day3.rs
@@ -48,15 +48,10 @@ use std::str::FromStr;
pub fn part1() {
let input = ::common::read_stdin_to_string();
- let mut claims: Vec<FabricClaim> = Vec::new();
-
- for line in input.lines() {
- claims.push(line.parse().expect("Parsing fabric claim"));
- }
-
let mut fabric: BTreeMap<(i64, i64), u8> = BTreeMap::new();
- for claim in claims.iter() {
+ for line in input.lines() {
+ let claim: FabricClaim = line.parse().expect("Parsing fabric claim");
for w in 0..claim.width {
for h in 0..claim.height {
let index = (claim.pos_x + w, claim.pos_y + h);