mirror of
https://github.com/serde-rs/json.git
synced 2026-03-21 09:03:56 +00:00
Merge pull request #824 from jplatte/box-raw-value-to-underlying
Add impl From<Box<RawValue>> for Box<str>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user