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