Skip to content

Commit

Permalink
Add impl From<Box<RawValue>> for Box<str>
Browse files Browse the repository at this point in the history
  • Loading branch information
jplatte committed Nov 13, 2021
1 parent a050481 commit 37fe6b5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/raw.rs
Expand Up @@ -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
Expand Down

0 comments on commit 37fe6b5

Please sign in to comment.