Integer encoding for primitive integer types: Supports varint/varint+zigzag and fixed-length integer encoding and decoding, and provides synchronous and asynchronous Write/Read types for easily writing/reading integers.
Other
66
stars
16
forks
source link
Impl FixedInt for i8/u8 and fix size for isize/usize #25
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.
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.
Impl FixedInt
fori8
andu8
, which could make some users' code (including mime) more consistent. I avoided endian converion oni8
/u8
, thinking this should bring a better performance.sz
from the macroimpl_fixedint
, usestd::mem::size_of
to obtain the size. The size ofisize
/usize
may not be8
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.