Optimizations

This commit is contained in:
Tony Garnock-Jones 2022-10-29 13:07:37 +02:00
parent d5dd02356b
commit c453f2eb0c
2 changed files with 6 additions and 4 deletions

View File

@ -39,6 +39,7 @@ impl From<InvalidTag> for crate::error::Error {
impl TryFrom<u8> for Tag {
type Error = InvalidTag;
#[inline(always)]
fn try_from(v: u8) -> Result<Self, Self::Error> {
match v {
0x80 => Ok(Self::False),
@ -65,6 +66,7 @@ impl TryFrom<u8> for Tag {
}
impl From<Tag> for u8 {
#[inline(always)]
fn from(v: Tag) -> Self {
match v {
Tag::False => 0x80,

View File

@ -1234,7 +1234,7 @@ impl<D: Domain> NestedValue for PlainValue<D> {
#[inline(always)]
fn annotations(&self) -> Option<&Annotations<Self>> {
self.0.0.as_ref()
if let Some(b) = &self.0.0 { Some(b) } else { None }
}
#[inline(always)]
@ -1284,7 +1284,7 @@ impl<D: Domain> NestedValue for RcValue<D> {
#[inline(always)]
fn annotations(&self) -> Option<&Annotations<Self>> {
self.0.0.as_ref()
if let Some(b) = &self.0.0 { Some(b) } else { None }
}
#[inline(always)]
@ -1334,7 +1334,7 @@ impl<D: Domain> NestedValue for ArcValue<D> {
#[inline(always)]
fn annotations(&self) -> Option<&Annotations<Self>> {
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>> {
self.0.0.as_ref()
if let Some(b) = &self.0.0 { Some(b) } else { None }
}
#[inline(always)]