Merge pull request #824 from jplatte/box-raw-value-to-underlying

Add impl From<Box<RawValue>> for Box<str>
This commit is contained in:
David Tolnay
2021-11-17 12:33:46 -08:00
committed by GitHub

View File

@@ -216,6 +216,12 @@ impl RawValue {
}
}
impl From<Box<RawValue>> for Box<str> {
fn from(val: Box<RawValue>) -> Self {
unsafe { mem::transmute::<Box<RawValue>, Box<str>>(val) }
}
}
/// Convert a `T` into a boxed `RawValue`.
///
/// # Example