diff --git a/Cargo.toml b/Cargo.toml index b1caf0a..21dc79f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "vault" -version = "10.1.5" +version = "10.2.0" edition = "2021" authors = ["Ryan Taylor <2320507+ryantaylor@users.noreply.github.com>"] @@ -15,7 +15,7 @@ exclude = ["replays/*", "build-doc.sh", ".travis.yml", "CoH3Rec.bt"] [dependencies] byteorder = "1" -magnus = { version = "0.7", optional = true } +magnus = { version = "0.8", optional = true } nom = "7" nom_locate = "4" nom-tracable = "0.9" diff --git a/README.md b/README.md index 8b401fc..f669d64 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # vault -[![crates.io](https://img.shields.io/crates/v/vault.svg)](https://crates.io/crates/vault) [![Documentation](https://img.shields.io/badge/View-Documentation-blue.svg)](https://docs.rs/vault/10.1.5/vault/) +[![crates.io](https://img.shields.io/crates/v/vault.svg)](https://crates.io/crates/vault) [![Documentation](https://img.shields.io/badge/View-Documentation-blue.svg)](https://docs.rs/vault/10.2.0/vault/) `vault` is a Company of Heroes replay parsing library written in [Rust](https://www.rust-lang.org/). It has been completely rewritten for Company of Heroes 3 to provide a more intuitive interface while simplifying the code and leveraging [nom](https://github.com/rust-bakery/nom)'s parser combinators to enable clean, fast parsing of Company of Heroes 3 replay files. @@ -112,7 +112,7 @@ Ruby bindings have some additional compatibility requirements, such as `libclang # Documentation -Documentation for `vault` [can be viewed online](https://docs.rs/vault/10.1.5/vault/). +Documentation for `vault` [can be viewed online](https://docs.rs/vault/10.2.0/vault/). Alternatively, you can easily build an offline copy of the documentation for yourself with `cargo`: diff --git a/src/data/chunks/chunk.rs b/src/data/chunks/chunk.rs index 145bea9..a21808c 100644 --- a/src/data/chunks/chunk.rs +++ b/src/data/chunks/chunk.rs @@ -17,7 +17,7 @@ impl Chunk { move |input: Span| { let (input, header) = Header::parse(input)?; - return match &header.chunk_kind as &str { + match &header.chunk_kind as &str { "DATA" => match &header.chunk_type as &str { "AUTO" => DataAutoChunk::parse(input, header), "DATA" => DataDataChunk::parse(input, header), @@ -26,7 +26,7 @@ impl Chunk { }, "FOLD" => FoldChunk::parse(input, header, version), _ => panic!(), - }; + } } } } diff --git a/src/errors.rs b/src/errors.rs index cc62026..305bc97 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -6,5 +6,4 @@ use crate::data::Span; /// that is, the first failure point hit will exit with an error. This type returns an error that /// includes information on the segment of bytes being parsed and the location of the cursor at /// time of failure. - pub type ParseError<'a> = nom::Err>>; diff --git a/src/replay.rs b/src/replay.rs index f95b56b..72a983e 100644 --- a/src/replay.rs +++ b/src/replay.rs @@ -43,7 +43,7 @@ impl Replay { /// assert!(replay.is_ok()) /// } /// ``` - pub fn from_bytes(input: &[u8]) -> Result { + pub fn from_bytes(input: &[u8]) -> Result> { let info = TracableInfo::new().parser_width(64).fold("term"); let input: Span = LocatedSpan::new_extra(input, info); let (_, replay) = ReplayData::from_span(input)?;