diff --git a/crates/libs/core/src/strings/pcstr.rs b/crates/libs/core/src/strings/pcstr.rs index 5535c5ae46..d4da2c3319 100644 --- a/crates/libs/core/src/strings/pcstr.rs +++ b/crates/libs/core/src/strings/pcstr.rs @@ -12,12 +12,12 @@ impl PCSTR { } /// Construct a null `PCSTR` - pub fn null() -> Self { + pub const fn null() -> Self { Self(std::ptr::null()) } /// Returns a raw pointer to the `PCSTR` - pub fn as_ptr(&self) -> *const u8 { + pub const fn as_ptr(&self) -> *const u8 { self.0 } diff --git a/crates/libs/core/src/strings/pstr.rs b/crates/libs/core/src/strings/pstr.rs index 6ea9d9c70c..634b7ac036 100644 --- a/crates/libs/core/src/strings/pstr.rs +++ b/crates/libs/core/src/strings/pstr.rs @@ -12,12 +12,12 @@ impl PSTR { } /// Construct a null `PSTR` - pub fn null() -> Self { + pub const fn null() -> Self { Self(std::ptr::null_mut()) } /// Returns a raw pointer to the `PSTR` - pub fn as_ptr(&self) -> *mut u8 { + pub const fn as_ptr(&self) -> *mut u8 { self.0 } diff --git a/crates/libs/core/src/strings/pwstr.rs b/crates/libs/core/src/strings/pwstr.rs index 052bfb9cf6..8ed6e7b1da 100644 --- a/crates/libs/core/src/strings/pwstr.rs +++ b/crates/libs/core/src/strings/pwstr.rs @@ -12,12 +12,12 @@ impl PWSTR { } /// Construct a null `PWSTR`. - pub fn null() -> Self { + pub const fn null() -> Self { Self(std::ptr::null_mut()) } /// Returns a raw pointer to the `PWSTR`. - pub fn as_ptr(&self) -> *mut u16 { + pub const fn as_ptr(&self) -> *mut u16 { self.0 }