identifiers: Get rid of pointless copy in ToOwned implementations

This commit is contained in:
Jonas Platte 2021-06-21 12:15:04 +02:00
parent d73ab8add9
commit e308c70aa7
No known key found for this signature in database
GPG Key ID: CC154DE0E30B7C67
2 changed files with 2 additions and 2 deletions

View File

@ -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())
}
}

View File

@ -53,7 +53,7 @@ impl ToOwned for ServerName {
type Owned = Box<ServerName>;
fn to_owned(&self) -> Self::Owned {
Self::from_owned(self.0.to_owned().into_boxed_str())
Self::from_owned(self.0.into())
}
}