mirror of
https://github.com/italicsjenga/agb.git
synced 2025-01-11 09:31:34 +11:00
constify sprite function
This commit is contained in:
parent
3b6ce1b2bd
commit
ebc4e15f3d
|
@ -249,8 +249,11 @@ impl Tag {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn sprite(&self, idx: usize) -> &'static Sprite {
|
pub const fn sprite(&self, idx: usize) -> &'static Sprite {
|
||||||
&self.sprites()[idx]
|
if idx >= self.len {
|
||||||
|
panic!("out of bounds access to sprite");
|
||||||
|
}
|
||||||
|
unsafe { &*self.sprites.add(idx) }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
|
|
Loading…
Reference in a new issue