From 21cf38a5429e32a703c2bc2ea02cbcbaf2985b01 Mon Sep 17 00:00:00 2001 From: Markus Westerlind Date: Thu, 30 Jan 2020 11:15:58 +0100 Subject: [PATCH] combine 4 --- Cargo.lock | 36 ++++++------------------------------ Cargo.toml | 2 +- src/main.rs | 6 +++--- 3 files changed, 10 insertions(+), 34 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d0d43f6..5192a76 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,28 +1,19 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. [[package]] -name = "ascii" -version = "0.9.3" +name = "bytes" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eab1c04a571841102f5345a8fc0f6bb3d31c315dec879b5c6e42e40ce7ffa34e" - -[[package]] -name = "byteorder" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7c3dd8985a7111efc5c80b44e23ecdd8c007de8ade3b96595387e812b957cf5" +checksum = "130aac562c0dd69c56b3b1cc8ffd2e17be31d0b6c25b61c96b76231aa23e39e1" [[package]] name = "combine" -version = "3.8.1" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da3da6baa321ec19e1cc41d31bf599f00c783d0517095cdaf0332e3fe8d20680" +checksum = "c875843236b5e2eb535fd0b696387bfb623f896479b10ed626cf442b836e8032" dependencies = [ - "ascii", - "byteorder", - "either", + "bytes", "memchr", - "unreachable", ] [[package]] @@ -44,18 +35,3 @@ name = "memchr" version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3197e20c7edb283f87c071ddfc7a2cca8f8e0b888c242959846a6fce03c72223" - -[[package]] -name = "unreachable" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" -dependencies = [ - "void", -] - -[[package]] -name = "void" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" diff --git a/Cargo.toml b/Cargo.toml index 29650f6..776b19b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" diff --git a/src/main.rs b/src/main.rs index 9125fb6..0c9baea 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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> +fn mcc_payload_item<'a, I: 'a>() -> impl Parser> where - I: RangeStream, - I::Error: ParseError, + I: RangeStream, + I::Error: ParseError, { choice!( token(b'G').map(|_| Either::Right([0xfau8, 0x00, 0x00].as_ref())),