mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
style: Miscellaneous Servo build fixes.
This commit is contained in:
parent
18cda1567a
commit
e227715aee
12 changed files with 59 additions and 10 deletions
|
@ -38,6 +38,34 @@ impl DerefMut for OwnedStr {
|
|||
}
|
||||
}
|
||||
|
||||
impl OwnedStr {
|
||||
/// Convert the OwnedStr into a boxed str.
|
||||
#[inline]
|
||||
pub fn into_box(self) -> Box<str> {
|
||||
self.into_string().into_boxed_str()
|
||||
}
|
||||
|
||||
/// Convert the OwnedStr into a `String`.
|
||||
#[inline]
|
||||
pub fn into_string(self) -> String {
|
||||
unsafe { String::from_utf8_unchecked(self.0.into_vec()) }
|
||||
}
|
||||
}
|
||||
|
||||
impl From<OwnedStr> for String {
|
||||
#[inline]
|
||||
fn from(b: OwnedStr) -> Self {
|
||||
b.into_string()
|
||||
}
|
||||
}
|
||||
|
||||
impl From<OwnedStr> for Box<str> {
|
||||
#[inline]
|
||||
fn from(b: OwnedStr) -> Self {
|
||||
b.into_box()
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Box<str>> for OwnedStr {
|
||||
#[inline]
|
||||
fn from(b: Box<str>) -> Self {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue