Skip to content

Commit

Permalink
combine 4
Browse files Browse the repository at this point in the history
  • Loading branch information
Markus Westerlind committed Jan 30, 2020
1 parent 6fa700d commit 21cf38a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 34 deletions.
36 changes: 6 additions & 30 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
combine = "3"
combine = "4"
either = "1"
6 changes: 3 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ use combine::parser::byte::hex_digit;
use combine::{choice, token};
use combine::{ParseError, Parser, RangeStream};

fn mcc_payload_item<'a, I: 'a>() -> impl Parser<Input = I, Output = Either<u8, &'static [u8]>>
fn mcc_payload_item<'a, I: 'a>() -> impl Parser<I, Output = Either<u8, &'static [u8]>>
where
I: RangeStream<Item = u8, Range = &'a [u8]>,
I::Error: ParseError<I::Item, I::Range, I::Position>,
I: RangeStream<Token = u8, Range = &'a [u8]>,
I::Error: ParseError<I::Token, I::Range, I::Position>,
{
choice!(
token(b'G').map(|_| Either::Right([0xfau8, 0x00, 0x00].as_ref())),
Expand Down

0 comments on commit 21cf38a

Please sign in to comment.