Skip to content

Commit

Permalink
Add 'static lifetime to const's
Browse files Browse the repository at this point in the history
  • Loading branch information
bheylin committed Dec 11, 2024
1 parent 9c9aa1f commit 4db66fb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/raw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,11 @@ pub struct RawValue {

impl RawValue {
/// A literal JSON null value as `RawValue`.
pub const NULL: &RawValue = RawValue::from_borrowed("null");
pub const NULL: &'static RawValue = RawValue::from_borrowed("null");
/// A literal JSON boolean true value as `RawValue`.
pub const TRUE: &RawValue = RawValue::from_borrowed("true");
pub const TRUE: &'static RawValue = RawValue::from_borrowed("true");
/// A literal JSON boolean false value as `RawValue`.
pub const FALSE: &RawValue = RawValue::from_borrowed("false");
pub const FALSE: &'static RawValue = RawValue::from_borrowed("false");

const fn from_borrowed(json: &str) -> &Self {
unsafe { mem::transmute::<&str, &RawValue>(json) }
Expand Down

0 comments on commit 4db66fb

Please # to comment.