Skip to content

Commit

Permalink
Added clippy and fmt to CI and fixes clippy issues
Browse files Browse the repository at this point in the history
Signed-off-by: Amjad Alsharafi <[email protected]>
  • Loading branch information
Amjad50 committed Oct 23, 2024
1 parent 0b78c71 commit dbec9f3
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 11 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ jobs:

- uses: actions/checkout@v4

- name: Format check
run: cargo fmt --all -- --check
- name: Clippy check
run: cargo clippy --all --all-targets --all-features -- -D warnings

# breaks for now since Cargo.lock is in a new version (4)
# - uses: actions-rs/audit-check@v1
# with:
Expand Down
4 changes: 0 additions & 4 deletions plastic_core/src/cartridge/mappers/mapper10.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,6 @@ pub struct Mapper10 {
/// +- Nametable mirroring (0: vertical; 1: horizontal)
mirroring_vertical: bool,

/// ($C000-$DFFE, even)
/// the value to reload `irq_counter` when it reaches zero or when asked
/// to be reloaded from `($C001-$DFFF, odd)`
/// is using CHR RAM?
is_chr_ram: bool,

Expand Down
4 changes: 0 additions & 4 deletions plastic_core/src/cartridge/mappers/mapper9.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,6 @@ pub struct Mapper9 {
/// +- Nametable mirroring (0: vertical; 1: horizontal)
mirroring_vertical: bool,

/// ($C000-$DFFE, even)
/// the value to reload `irq_counter` when it reaches zero or when asked
/// to be reloaded from `($C001-$DFFF, odd)`
/// is using CHR RAM?
is_chr_ram: bool,

Expand Down
2 changes: 1 addition & 1 deletion plastic_core/src/cpu6502/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1443,7 +1443,7 @@ struct WrapperReader<'a, R: Read> {
pub inner: &'a mut R,
}

impl<'a, R: Read> Read for WrapperReader<'a, R> {
impl<R: Read> Read for WrapperReader<'_, R> {
fn read(&mut self, buf: &mut [u8]) -> std::io::Result<usize> {
self.inner.read(buf)
}
Expand Down
6 changes: 6 additions & 0 deletions plastic_core/src/misc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ pub struct MovingAverage {
sum: f64,
}

impl Default for MovingAverage {
fn default() -> Self {
Self::new()
}

Check warning on line 14 in plastic_core/src/misc.rs

View check run for this annotation

Codecov / codecov/patch

plastic_core/src/misc.rs#L12-L14

Added lines #L12 - L14 were not covered by tests
}

impl MovingAverage {
pub fn new() -> Self {
Self {
Expand Down
3 changes: 1 addition & 2 deletions plastic_core/src/ppu2c02/sprite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,8 @@ impl Sprite {

/// for 8x8:
/// use the byte normally as index into the pattern table
///
/// for 8x16:
/// 76543210
/// ||||||||
/// |||||||+- Bank ($0000 or $1000) of tiles
Expand Down

0 comments on commit dbec9f3

Please sign in to comment.