From 9527ecc5855d0a1376f43340cf55feb63e38090f Mon Sep 17 00:00:00 2001 From: Elsie Date: Sun, 12 Jan 2025 15:08:23 -0500 Subject: [PATCH] Zero is one :) --- src/lib.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 9b0ee30..fa63ed5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -223,10 +223,9 @@ impl Type<'_> { /// Returns byte size for values of the type pub fn size(&self) -> u64 { match self { - Self::Byte | Self::SignedByte | Self::UnsignedByte => 1, + Self::Byte | Self::SignedByte | Self::UnsignedByte | Self::Zero => 1, Self::Halfword | Self::SignedHalfword | Self::UnsignedHalfword => 2, - // TODO: I don't actually know if [`Zero`] is 4. - Self::Word | Self::Single | Self::Zero => 4, + Self::Word | Self::Single => 4, Self::Long | Self::Double => 8, Self::Aggregate(td) => { // TODO: correct for alignment