aboutsummaryrefslogtreecommitdiffstats
path: root/src/day3.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/day3.rs')
-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);