From 59161b842bd142d752ce573b27d288e8c6bb64d2 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Mon, 21 Jun 2021 12:23:52 +0200 Subject: [PATCH] identifiers: Use fewer transmutes for ServerName --- crates/ruma-identifiers/src/server_name.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/ruma-identifiers/src/server_name.rs b/crates/ruma-identifiers/src/server_name.rs index 8f25e708..74110d98 100644 --- a/crates/ruma-identifiers/src/server_name.rs +++ b/crates/ruma-identifiers/src/server_name.rs @@ -19,11 +19,11 @@ impl ServerName { } fn from_owned(s: Box) -> Box { - unsafe { mem::transmute(s) } + unsafe { Box::from_raw(Box::into_raw(s) as _) } } fn into_owned(self: Box) -> Box { - unsafe { mem::transmute(self) } + unsafe { Box::from_raw(Box::into_raw(self) as _) } } /// Creates a string slice from this `ServerName`.