You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These can be directly implemented with from_le_bytes or from_be_bytes from the standard library.
The names of the functions can be different than I suggest here, decode_f32(buf: [u8; 4]) -> f32 is very close to fn read_f32(buf: &[u8]) -> f32, the only real difference is that the size of the input buffer is fixed.
The text was updated successfully, but these errors were encountered:
It would be useful to have functions that convert between
[u8; N]
and number primitive types, whereN
is the size in bytes of that number type.Public api example:
These can be directly implemented with
from_le_bytes
orfrom_be_bytes
from the standard library.The names of the functions can be different than I suggest here,
decode_f32(buf: [u8; 4]) -> f32
is very close tofn read_f32(buf: &[u8]) -> f32
, the only real difference is that the size of the input buffer is fixed.The text was updated successfully, but these errors were encountered: