identifiers: Use fewer transmutes for ServerName
This commit is contained in:
parent
e308c70aa7
commit
59161b842b
@ -19,11 +19,11 @@ impl ServerName {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn from_owned(s: Box<str>) -> Box<Self> {
|
fn from_owned(s: Box<str>) -> Box<Self> {
|
||||||
unsafe { mem::transmute(s) }
|
unsafe { Box::from_raw(Box::into_raw(s) as _) }
|
||||||
}
|
}
|
||||||
|
|
||||||
fn into_owned(self: Box<Self>) -> Box<str> {
|
fn into_owned(self: Box<Self>) -> Box<str> {
|
||||||
unsafe { mem::transmute(self) }
|
unsafe { Box::from_raw(Box::into_raw(self) as _) }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Creates a string slice from this `ServerName`.
|
/// Creates a string slice from this `ServerName`.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user