Skip to content

Commit

Permalink
Fix for Clippy HSTRING interior mutability warnings in nightly (#3021)
Browse files Browse the repository at this point in the history
  • Loading branch information
riverar committed May 3, 2024
1 parent 7b3de56 commit 1256fbe
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crates/libs/core/src/strings/literals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ macro_rules! h {
($s:literal) => {{
const INPUT: &[u8] = $s.as_bytes();
const OUTPUT_LEN: usize = $crate::utf16_len(INPUT) + 1;
#[allow(clippy::declare_interior_mutable_const)]
const RESULT: $crate::HSTRING = {
if OUTPUT_LEN == 1 {
unsafe { ::std::mem::transmute(::std::ptr::null::<u16>()) }
Expand All @@ -51,6 +52,7 @@ macro_rules! h {
unsafe { ::std::mem::transmute::<&$crate::HSTRING_HEADER, $crate::HSTRING>(&HEADER) }
}
};
#[allow(clippy::borrow_interior_mutable_const)]
&RESULT
}};
}
Expand Down

0 comments on commit 1256fbe

Please sign in to comment.