Rework previous regex use.

This commit is contained in:
2018-12-04 13:49:16 +01:00
parent 1e51012d5e
commit 43eeacc686
2 changed files with 1061 additions and 4 deletions

1057
2018/inputs/04 Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -48,10 +48,10 @@ impl Day03 {
let matched = matcher.captures(&line).unwrap(); let matched = matcher.captures(&line).unwrap();
let claim = Claim{ let claim = Claim{
x: matched.get(2).unwrap().as_str().parse().unwrap(), x: matched[2].parse().unwrap(),
y: matched.get(3).unwrap().as_str().parse().unwrap(), y: matched[3].parse().unwrap(),
width: matched.get(4).unwrap().as_str().parse().unwrap(), width: matched[4].parse().unwrap(),
height: matched.get(5).unwrap().as_str().parse().unwrap(), height: matched[5].parse().unwrap(),
}; };
self.claims.push(claim); self.claims.push(claim);
} }