From e308c70aa75e8870ead8edc550174f23e6d705f6 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Mon, 21 Jun 2021 12:15:04 +0200 Subject: [PATCH] identifiers: Get rid of pointless copy in ToOwned implementations --- crates/ruma-identifiers/src/macros.rs | 2 +- crates/ruma-identifiers/src/server_name.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/ruma-identifiers/src/macros.rs b/crates/ruma-identifiers/src/macros.rs index dcd27856..095e14f6 100644 --- a/crates/ruma-identifiers/src/macros.rs +++ b/crates/ruma-identifiers/src/macros.rs @@ -220,7 +220,7 @@ macro_rules! opaque_identifier { type Owned = Box<$id>; fn to_owned(&self) -> Self::Owned { - Self::from_owned(self.0.to_owned().into_boxed_str()) + Self::from_owned(self.0.into()) } } diff --git a/crates/ruma-identifiers/src/server_name.rs b/crates/ruma-identifiers/src/server_name.rs index e59ea8c8..8f25e708 100644 --- a/crates/ruma-identifiers/src/server_name.rs +++ b/crates/ruma-identifiers/src/server_name.rs @@ -53,7 +53,7 @@ impl ToOwned for ServerName { type Owned = Box; fn to_owned(&self) -> Self::Owned { - Self::from_owned(self.0.to_owned().into_boxed_str()) + Self::from_owned(self.0.into()) } }