Skip to content

impl: add read/write_u8/i8 to ByteOrder#222

Open
tisonkun wants to merge 1 commit intoBurntSushi:masterfrom
tisonkun:byteorder-8bit
Open

impl: add read/write_u8/i8 to ByteOrder#222
tisonkun wants to merge 1 commit intoBurntSushi:masterfrom
tisonkun:byteorder-8bit

Conversation

@tisonkun
Copy link
Copy Markdown

@tisonkun tisonkun commented Nov 22, 2025

This refers to #92.

cc @BurntSushi

Comment thread src/lib.rs
Comment on lines +1961 to +1964
#[inline]
fn read_u8(buf: &[u8]) -> u8 {
buf[0]
}
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two methods are the same regardless of the endianness. Not sure if we'd add it as the default impl.

I implement them separately now to make it clear and avoid assumptions before consensus.

Signed-off-by: tison <wander4096@gmail.com>
@tisonkun
Copy link
Copy Markdown
Author

@BurntSushi any spare time to give this a review?

cc @regexident you can review whether this is what you need as well.

@BurntSushi
Copy link
Copy Markdown
Owner

This is an extremely low priority PR. I will get around to it when I get to it.

Copy link
Copy Markdown

@regexident regexident left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants