diff --git a/src/raw.rs b/src/raw.rs index a0607bc5b..a0e16305c 100644 --- a/src/raw.rs +++ b/src/raw.rs @@ -122,6 +122,10 @@ impl RawValue { fn from_owned(json: Box) -> Box { unsafe { mem::transmute::, Box>(json) } } + + fn into_owned(raw_value: Box) -> Box { + unsafe { mem::transmute::, Box>(raw_value) } + } } impl Clone for Box { @@ -217,8 +221,8 @@ impl RawValue { } impl From> for Box { - fn from(val: Box) -> Self { - unsafe { mem::transmute::, Box>(val) } + fn from(raw_value: Box) -> Self { + RawValue::into_owned(raw_value) } }