Skip to content

Commit f42c7c7

Browse files
committed
Move RawValue associated constants into same impl block as public functions
1 parent 96576ba commit f42c7c7

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/raw.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,6 @@ pub struct RawValue {
119119
}
120120

121121
impl RawValue {
122-
/// A literal JSON null value as `RawValue`.
123-
pub const NULL: &'static RawValue = RawValue::from_borrowed("null");
124-
/// A literal JSON boolean true value as `RawValue`.
125-
pub const TRUE: &'static RawValue = RawValue::from_borrowed("true");
126-
/// A literal JSON boolean false value as `RawValue`.
127-
pub const FALSE: &'static RawValue = RawValue::from_borrowed("false");
128-
129122
const fn from_borrowed(json: &str) -> &Self {
130123
unsafe { mem::transmute::<&str, &RawValue>(json) }
131124
}
@@ -175,6 +168,13 @@ impl Display for RawValue {
175168
}
176169

177170
impl RawValue {
171+
/// A literal JSON null value as `RawValue`.
172+
pub const NULL: &'static RawValue = RawValue::from_borrowed("null");
173+
/// A literal JSON boolean true value as `RawValue`.
174+
pub const TRUE: &'static RawValue = RawValue::from_borrowed("true");
175+
/// A literal JSON boolean false value as `RawValue`.
176+
pub const FALSE: &'static RawValue = RawValue::from_borrowed("false");
177+
178178
/// Convert an owned `String` of JSON data to an owned `RawValue`.
179179
///
180180
/// This function is equivalent to `serde_json::from_str::<Box<RawValue>>`

0 commit comments

Comments
 (0)