Diffstat (limited to 'src/symbol.rs')
| -rw-r--r-- | src/symbol.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/symbol.rs b/src/symbol.rs index 7e1ee46..e5d984f 100644 --- a/src/symbol.rs +++ b/src/symbol.rs @@ -65,6 +65,7 @@ impl Symbol { /// is too complex to store in the symbol then a /// [`EncodeError::TooComplex`] error is returned. If this happens try using /// a shorter tag and/or remove capitals and numbers. + #[inline] pub const fn try_new(tag: &str) -> Result<Self, EncodeError<'_>> { match encode(tag) { Ok(tag) => Ok(Self(tag)), @@ -84,6 +85,7 @@ impl Symbol { /// type OtherType = MyType<{ Symbol::new("OtherType").to_int() }>; /// # let _: OtherType; /// ``` + #[inline] pub const fn to_int(self) -> u64 { self.0 } @@ -97,6 +99,7 @@ impl Symbol { /// [`Self::to_int()`] is provided then the Symbol will likely display /// as a random string when calling [`Display::fmt()`][core::fmt::Display::fmt] /// or [`Debug::fmt()`][core::fmt::Debug::fmt]. + #[inline] pub const fn from_int(value: u64) -> Self { Self(value) } @@ -104,6 +107,7 @@ impl Symbol { /// Const form of [`PartialEq::eq()`]. /// /// Checking for equality via [`Self::to_int()`] is also possible. + #[inline] pub const fn eq(self, other: Self) -> bool { self.0 == other.0 } |