identifiers: Get rid of pointless copy in ToOwned implementations
This commit is contained in:
parent
d73ab8add9
commit
e308c70aa7
@ -220,7 +220,7 @@ macro_rules! opaque_identifier {
|
|||||||
type Owned = Box<$id>;
|
type Owned = Box<$id>;
|
||||||
|
|
||||||
fn to_owned(&self) -> Self::Owned {
|
fn to_owned(&self) -> Self::Owned {
|
||||||
Self::from_owned(self.0.to_owned().into_boxed_str())
|
Self::from_owned(self.0.into())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ impl ToOwned for ServerName {
|
|||||||
type Owned = Box<ServerName>;
|
type Owned = Box<ServerName>;
|
||||||
|
|
||||||
fn to_owned(&self) -> Self::Owned {
|
fn to_owned(&self) -> Self::Owned {
|
||||||
Self::from_owned(self.0.to_owned().into_boxed_str())
|
Self::from_owned(self.0.into())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user