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 aea15530..2eebdf73 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -778,6 +778,7 @@ impl Uuid { /// &bytes1 as *const [u8; 16] as *const u8, /// )); /// ``` + #[inline] pub const fn as_bytes(&self) -> &Bytes { &self.0 } @@ -797,6 +798,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 }