You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error[E0308]: mismatched types
--> src/test.rs:46:9
|
461 | #[derive(Debug, BinRead)]
| ------- this type parameter
...
467 | #[br(map_stream = |s| s.take_seek(16), parse_with = helpers::until_eof, args(v))]
| ------- arguments to this function are incorrect
468 | data: Vec<Thing>,
| ^^^^ expected `&mut R`, found `&mut TakeSeek<&mut R>`
|
= note: expected mutable reference `&mut R`
found mutable reference `&mut TakeSeek<&mut R>`
note: function defined here
--> /home/nofitserov/.cargo/registry/src/index.crates.io-6f17d22bba15001f/binrw-0.13.1/src/helpers.rs:213:8
|
213 | pub fn until_eof<Reader, T, Arg, Ret>(
| ^^^^^^^^^
It seems that currently parse_function_args_type_hint unconditionally asserts/requires that the first argument to the parse function is of type &mut R, regardless of map_stream presence.
The text was updated successfully, but these errors were encountered:
Notice the following line in the example from #217:
#[br(map_stream = |s| s.take_seek(16), parse_with = |r, e, _:()| until_eof(r, e, (v,)))]
I expect there to be a simpler way to achieve this:
#[br(map_stream = |s| s.take_seek(16), parse_with = until_eof, args(v))]
Surprisingly, this fails to compile:
It seems that currently
parse_function_args_type_hint
unconditionally asserts/requires that the first argument to the parse function is of type&mut R
, regardless ofmap_stream
presence.The text was updated successfully, but these errors were encountered: