diff --git a/implementations/rust/preserves/src/value/packed/constants.rs b/implementations/rust/preserves/src/value/packed/constants.rs index 90feaed..6e001e0 100644 --- a/implementations/rust/preserves/src/value/packed/constants.rs +++ b/implementations/rust/preserves/src/value/packed/constants.rs @@ -39,6 +39,7 @@ impl From for crate::error::Error { impl TryFrom for Tag { type Error = InvalidTag; + #[inline(always)] fn try_from(v: u8) -> Result { match v { 0x80 => Ok(Self::False), @@ -65,6 +66,7 @@ impl TryFrom for Tag { } impl From for u8 { + #[inline(always)] fn from(v: Tag) -> Self { match v { Tag::False => 0x80, diff --git a/implementations/rust/preserves/src/value/repr.rs b/implementations/rust/preserves/src/value/repr.rs index a86b1da..67d1948 100644 --- a/implementations/rust/preserves/src/value/repr.rs +++ b/implementations/rust/preserves/src/value/repr.rs @@ -1234,7 +1234,7 @@ impl NestedValue for PlainValue { #[inline(always)] fn annotations(&self) -> Option<&Annotations> { - self.0.0.as_ref() + if let Some(b) = &self.0.0 { Some(b) } else { None } } #[inline(always)] @@ -1284,7 +1284,7 @@ impl NestedValue for RcValue { #[inline(always)] fn annotations(&self) -> Option<&Annotations> { - self.0.0.as_ref() + if let Some(b) = &self.0.0 { Some(b) } else { None } } #[inline(always)] @@ -1334,7 +1334,7 @@ impl NestedValue for ArcValue { #[inline(always)] fn annotations(&self) -> Option<&Annotations> { - self.0.0.as_ref() + if let Some(b) = &self.0.0 { Some(b) } else { None } } #[inline(always)] @@ -1388,7 +1388,7 @@ impl NestedValue for IOValue { #[inline(always)] fn annotations(&self) -> Option<&Annotations> { - self.0.0.as_ref() + if let Some(b) = &self.0.0 { Some(b) } else { None } } #[inline(always)]