Merge pull request #213 from gwilymk/use-unsigned-abs

Use unsigned_abs to satisfy clippy
This commit is contained in:
Gwilym Kuiper 2022-04-11 21:32:23 +01:00 committed by GitHub
commit 592543ee7b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -255,8 +255,8 @@ impl Tag {
Direction::Forward => self.sprite(idx % self.len), Direction::Forward => self.sprite(idx % self.len),
Direction::Backward => self.sprite(len_sub_1 - (idx % self.len)), Direction::Backward => self.sprite(len_sub_1 - (idx % self.len)),
Direction::Pingpong => self.sprite( Direction::Pingpong => self.sprite(
(((idx + len_sub_1) % (len_sub_1 * 2)) as isize - len_sub_1 as isize).abs() (((idx + len_sub_1) % (len_sub_1 * 2)) as isize - len_sub_1 as isize)
as usize, .unsigned_abs(),
), ),
} }
} }