jam1garner / binrw

A Rust crate for helping parse and rebuild binary data using ✨macro magic✨.
https://binrw.rs
MIT License
585 stars 35 forks source link

attempt fix for https://github.com/jam1garner/binrw/issues/125 #126

Closed qtfkwk closed 2 years ago

qtfkwk commented 2 years ago

Implemented the suggested fix: https://github.com/jam1garner/binrw/issues/125#issuecomment-1142389738

Resolves the error observed in https://github.com/qtfkwk/br-eof-poc by simply changing its Cargo.toml to use a local clone with the path:

diff --git a/Cargo.toml b/Cargo.toml
index 6ec32bf..507f5b4 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -7,4 +7,5 @@ edition = "2021"

 [dependencies]
 #binread = "2.2.0"
-binrw = "0.8.4"
+#binrw = "0.8.4"
+binrw = { path = "../../github.com/qtfkwk/binrw/binrw" }

Checked the CONTRIBUTING.md and don't believe this change requires any change to the doc or interface except to say that it makes the is_eof function check if all the variant errors are UnexpectedEof if the error is an EnumErrors.

qtfkwk commented 2 years ago

can also use binrw = { git = "https://github.com/qtfkwk/binrw", branch = "125" } in Cargo.toml