diff --git a/src/builder.rs b/src/builder.rs index 60aeb435..403ce1da 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -412,6 +412,7 @@ impl Uuid { /// # Ok(()) /// # } /// ``` + #[inline] pub const fn from_bytes(bytes: Bytes) -> Uuid { Uuid(bytes) } @@ -480,6 +481,7 @@ impl Uuid { /// # Ok(()) /// # } /// ``` + #[inline] pub fn from_bytes_ref(bytes: &Bytes) -> &Uuid { // SAFETY: `Bytes` and `Uuid` have the same ABI unsafe { &*(bytes as *const Bytes as *const Uuid) } diff --git a/src/lib.rs b/src/lib.rs index f08b42d9..911eee2e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -783,6 +783,7 @@ impl Uuid { /// &bytes1 as *const [u8; 16] as *const u8, /// )); /// ``` + #[inline] pub const fn as_bytes(&self) -> &Bytes { &self.0 } @@ -802,6 +803,7 @@ impl Uuid { /// let uuid = Uuid::from_bytes(bytes); /// assert_eq!(bytes, uuid.into_bytes()); /// ``` + #[inline] pub const fn into_bytes(self) -> Bytes { self.0 }