We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5af65da commit 8084fc9Copy full SHA for 8084fc9
1 file changed
libcc2rs/src/reinterpret.rs
@@ -33,6 +33,10 @@ pub trait ByteRepr: 'static {
33
macro_rules! impl_byte_repr {
34
($ty:ty) => {
35
impl ByteRepr for $ty {
36
+ #[inline]
37
+ fn byte_size() -> usize {
38
+ std::mem::size_of::<$ty>()
39
+ }
40
#[inline]
41
fn to_bytes(&self, buf: &mut [u8]) {
42
buf.copy_from_slice(&self.to_ne_bytes());
@@ -61,6 +65,10 @@ impl_byte_repr!(f32);
61
65
impl_byte_repr!(f64);
62
66
63
67
impl ByteRepr for bool {
68
69
70
+ 1
71
64
72
73
74
buf[0] = *self as u8;
0 commit comments