Add fixed-width integer peeks for byte readers
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 75/100
Research direction
The issue points to std/bytes/cursor.wave and std/bytes/read.wave. Start by examining the existing bytes_reader_peek_u8 function and the read helpers for u16, u32, u64 to understand the signatures and error codes. Implement peek helpers that use a snapshot or checked offset reads without mutating the reader's position. Write tests to verify peeks decode correctly without advancing position, and that failures preserve state. Run the regressions at O0/O2 as specified.
Written by the indexing model from the issue text.
Description
Motivation
std/bytes/cursor.wave provides bytes_reader_peek_u8, but inspecting a multi-byte header currently requires callers to save and restore cursor state or construct another reader.
Scope
Add big-endian and little-endian peek helpers for u16, u32, and u64, following existing read-helper signatures and error codes. Use a reader snapshot or checked offset reads from std/bytes/read.wave without temporarily mutating the caller's reader.
Keep existing reads and the u8 peek unchanged. Signed peeks and variable-length encodings can be separate additions.
Completion criteria
- Successful peeks decode the expected value without advancing
position. - Failures preserve both position and the output value.
- Cover both byte orders, nonzero positions, exact-fit buffers, EOF, invalid reader state, and null output.
- Run focused regressions at O0/O2 without allocation or an OS dependency.
Difficulty: easy.
- Dominant language
- Rust
- Stars
- 53
- Forks
- 16
- Avg merge
- 3h 38m
- Merged PRs (30d)
- 48
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from wavefnd/Wave
-
enhancement good first issue needs testing
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
bug ci good first issue needs testing
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
bug ci good first issue needs testing
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
bug good first issue needs testing
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
bug good first issue os compatibility
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
TheLarkInn/aipm#2413 ·
-
documentation
Difficulty 1/5 Under an hour Newbie friendliness 90/100
alexgorbatchev/simple-ptt#15 ·
-
tooling
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
todo:ticket
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
taikoxyz/taiko-mono#22168 · 1 comment ·