Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Impl FixedInt for i8/u8 and fix size for isize/usize #25

Merged
merged 1 commit into from
Jun 22, 2022
Merged

Impl FixedInt for i8/u8 and fix size for isize/usize #25

merged 1 commit into from
Jun 22, 2022

Conversation

changrui0608
Copy link
Contributor

  1. AddedImpl FixedInt for i8 and u8, which could make some users' code (including mime) more consistent. I avoided endian converion on i8/u8, thinking this should bring a better performance.
  2. Removed the size parameter sz from the macro impl_fixedint, use std::mem::size_of to obtain the size. The size of isize/usize may not be 8 on some platform, operating raw memory on with incorrect length should cause unpredictable behavior (if I've got it right).

This is my first public PR on Github, and I'm still new to Rust language, so please let me know if something is incorrect.

@dermesser
Copy link
Owner

Thank you, the tests already pass, and I will take a closer look soon. It looks great at first sight!

@dermesser dermesser merged commit 919dfb3 into dermesser:master Jun 22, 2022
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.

2 participants