mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-23 08:11:33 +11:00
Fix clippy lints from 04/07/2023 (#454)
Fixes the latest batch of build failures - [x] no changelog update needed
This commit is contained in:
commit
a8544a9b41
|
@ -14,7 +14,7 @@ unsafe impl<T> Send for SendNonNull<T> {}
|
|||
|
||||
impl<T> Clone for SendNonNull<T> {
|
||||
fn clone(&self) -> Self {
|
||||
SendNonNull(self.0)
|
||||
*self
|
||||
}
|
||||
}
|
||||
impl<T> Copy for SendNonNull<T> {}
|
||||
|
|
|
@ -154,7 +154,7 @@ mod test {
|
|||
|
||||
#[test_case]
|
||||
fn test_all_of_memcpy(_gba: &mut Gba) {
|
||||
let mut input = vec![0u8; 100];
|
||||
let mut input = [0u8; 100];
|
||||
let mut output = vec![0u8; 100];
|
||||
|
||||
for size in 0..80 {
|
||||
|
|
|
@ -110,7 +110,7 @@ impl OamSlot<'_> {
|
|||
if let Some(affine_matrix) = &object.affine_matrix {
|
||||
Self::handle_affine(&mut attributes, frame_data, affine_matrix);
|
||||
}
|
||||
attributes.write(unsafe { (OBJECT_ATTRIBUTE_MEMORY as *mut u16).add(self.slot * 4) });
|
||||
attributes.write(unsafe { OBJECT_ATTRIBUTE_MEMORY.add(self.slot * 4) });
|
||||
|
||||
frame_data.this_frame_sprites.push(object.sprite.clone());
|
||||
}
|
||||
|
@ -160,7 +160,7 @@ impl Drop for OamIterator<'_> {
|
|||
|
||||
for idx in number_writen..*last_frame_written {
|
||||
unsafe {
|
||||
let ptr = (OBJECT_ATTRIBUTE_MEMORY as *mut u16).add(idx * 4);
|
||||
let ptr = OBJECT_ATTRIBUTE_MEMORY.add(idx * 4);
|
||||
ptr.write_volatile(0b10 << 8);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -189,7 +189,7 @@ impl TileSetting {
|
|||
}
|
||||
}
|
||||
|
||||
pub(self) fn find_screenblock_gap(screenblocks: &Bitarray<1>, gap: usize) -> usize {
|
||||
fn find_screenblock_gap(screenblocks: &Bitarray<1>, gap: usize) -> usize {
|
||||
let mut candidate = 0;
|
||||
|
||||
'outer: while candidate < 16 - gap {
|
||||
|
|
|
@ -1002,7 +1002,7 @@ impl SlimeData {
|
|||
entity.sprite.set_sprite(sprite);
|
||||
|
||||
entity.velocity.x = match frame {
|
||||
2 | 3 | 4 => (Number::new(1) / 5) * Number::new(*direction as i32),
|
||||
2..=4 => (Number::new(1) / 5) * Number::new(*direction as i32),
|
||||
_ => 0.into(),
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue