mirror of
https://github.com/italicsjenga/gba.git
synced 2024-12-23 19:01:30 +11:00
must_use
This commit is contained in:
parent
2ebe3cc510
commit
9924653a90
|
@ -118,6 +118,7 @@ impl<const N: usize> Align4<[u8; N]> {
|
|||
/// ## Panics
|
||||
/// * If the number of bytes isn't a multiple of 4
|
||||
#[inline]
|
||||
#[must_use]
|
||||
pub fn as_u32_slice(&self) -> &[u32] {
|
||||
assert!(self.0.len() % 4 == 0);
|
||||
// Safety: our struct is aligned to 4, so the pointer will already be
|
||||
|
@ -133,6 +134,7 @@ impl<const N: usize> Align4<[u8; N]> {
|
|||
/// ## Panics
|
||||
/// * If the number of bytes isn't a multiple of 2
|
||||
#[inline]
|
||||
#[must_use]
|
||||
pub fn as_u16_slice(&self) -> &[u16] {
|
||||
assert!(self.0.len() % 2 == 0);
|
||||
// Safety: our struct is aligned to 4, so the pointer will already be
|
||||
|
|
Loading…
Reference in a new issue