Check-in broken & partial try_read_u32 function

I'm saving this to the repo so I can possibly come back and fix it up
correctly.

A major API change is going to be attempted. The iterator-based stream
processing has proven to be fiddly and annoying, so I'm going to switch
to a processing the complete image.
This commit is contained in:
2024-07-02 13:19:14 -05:00
parent 6a5e2b3ab9
commit c6e94fcb5b

View File

@@ -19,8 +19,13 @@ pub fn try_read_magic<I: Iterator<Item=u8>>(bytes: &mut I) -> Result<(), DecodeE
fn try_read_u32<I: Iterator<Item=u8>>(bytes: &mut I) -> Result<u32, DecodeError> {
let mut res: u32 = 0;
Ok(res)
let i = bytes.take(4)
.enumerate()
.reduce(|acc, (idx, val)| {
(0, 0)
});
Ok(res)
}
mod codec_utils {