Skip to content

Commit

Permalink
fix: wrong as_u8 generated for enum (#413)
Browse files Browse the repository at this point in the history
  • Loading branch information
huyhduong1401 authored Nov 15, 2023
1 parent f42a068 commit 0ea9024
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/sol-macro/src/expand/enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ pub(super) fn expand(cx: &ExpCtxt<'_>, enumm: &ItemEnum) -> Result<TokenStream>
#[allow(unsafe_code, clippy::inline_always)]
#[inline(always)]
fn as_u8(&self) -> &u8 {
unsafe { &*::core::ptr::addr_of!(self).cast::<u8>() }
unsafe { &*(self as *const Self as *const u8) }
}
}
};
Expand Down

0 comments on commit 0ea9024

Please sign in to comment.