use .value() for instructions
This commit is contained in:
parent
6c894246f4
commit
56ca0b72a8
1 changed files with 3 additions and 5 deletions
|
@ -11,7 +11,7 @@ fn main() {
|
|||
println!("{}", pt2(&input));
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Eq)]
|
||||
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
|
||||
enum Inst {
|
||||
Mul(i64, i64),
|
||||
Do,
|
||||
|
@ -56,13 +56,11 @@ fn parse_mul(input: &mut &str) -> PResult<Inst> {
|
|||
}
|
||||
|
||||
fn parse_do(input: &mut &str) -> PResult<Inst> {
|
||||
let _ = "do()".parse_next(input)?;
|
||||
Ok(Inst::Do)
|
||||
"do()".value(Inst::Do).parse_next(input)
|
||||
}
|
||||
|
||||
fn parse_dont(input: &mut &str) -> PResult<Inst> {
|
||||
let _ = "don't()".parse_next(input)?;
|
||||
Ok(Inst::Dont)
|
||||
"don't()".value(Inst::Dont).parse_next(input)
|
||||
}
|
||||
|
||||
fn parse_inst(input: &mut &str) -> PResult<Inst> {
|
||||
|
|
Loading…
Reference in a new issue