Skip to content

Commit

Permalink
clippy lint
Browse files Browse the repository at this point in the history
  • Loading branch information
breqdev committed Apr 14, 2024
1 parent 83adeb4 commit 69ba92e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 22 deletions.
4 changes: 2 additions & 2 deletions src/memory/mos652x/pia.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ impl PiaPortRegisters {
// CX1
if cx1 != prev_cx1 {
let direction = self.control & pia_control_bits::C1_ACTIVE_TRANSITION;
if (direction == 0 && cx1 == false) || (direction != 0 && cx1 == true) {
if (direction == 0 && !cx1) || (direction != 0 && cx1) {

Check warning on line 71 in src/memory/mos652x/pia.rs

View check run for this annotation

Codecov / codecov/patch

src/memory/mos652x/pia.rs#L69-L71

Added lines #L69 - L71 were not covered by tests
// matching edge detected
self.control |= pia_control_bits::C1_ACTIVE_TRANSITION_FLAG;

Expand All @@ -83,7 +83,7 @@ impl PiaPortRegisters {
// input
if cx2 != prev_cx2 {
let direction = self.control & pia_control_bits::C2_INPUT_ACTIVE_TRANSITION;
if (direction == 0 && cx2 == false) || (direction != 0 && cx2 == true) {
if (direction == 0 && !cx2) || (direction != 0 && cx2) {

Check warning on line 86 in src/memory/mos652x/pia.rs

View check run for this annotation

Codecov / codecov/patch

src/memory/mos652x/pia.rs#L84-L86

Added lines #L84 - L86 were not covered by tests
// matching edge detected
self.control |= pia_control_bits::C2_ACTIVE_TRANSITION_FLAG;

Expand Down
38 changes: 18 additions & 20 deletions src/memory/mos652x/via.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,17 +213,16 @@ impl Memory for Via {
}

Check warning on line 213 in src/memory/mos652x/via.rs

View check run for this annotation

Codecov / codecov/patch

src/memory/mos652x/via.rs#L209-L213

Added lines #L209 - L213 were not covered by tests
}

if self.pcr & pcr_control_bits::CA2_DIRECTION != 0 {
if (self.pcr & pcr_control_bits::CA2_INPUT_ACTIVE_TRANSITION == 0
if (self.pcr & pcr_control_bits::CA2_DIRECTION != 0)
&& (self.pcr & pcr_control_bits::CA2_INPUT_ACTIVE_TRANSITION == 0
&& ca2 == ActiveTransition::Rising)

Check warning on line 218 in src/memory/mos652x/via.rs

View check run for this annotation

Codecov / codecov/patch

src/memory/mos652x/via.rs#L217-L218

Added lines #L217 - L218 were not covered by tests
|| (self.pcr & pcr_control_bits::CA2_INPUT_ACTIVE_TRANSITION != 0
&& ca2 == ActiveTransition::Falling)
{
self.interrupts.set_flag(interrupt_bits::CA2);

if self.interrupts.is_enabled(interrupt_bits::CA2) {
active_interrupt = ActiveInterrupt::IRQ;
}
|| (self.pcr & pcr_control_bits::CA2_INPUT_ACTIVE_TRANSITION != 0
&& ca2 == ActiveTransition::Falling)

Check warning on line 220 in src/memory/mos652x/via.rs

View check run for this annotation

Codecov / codecov/patch

src/memory/mos652x/via.rs#L220

Added line #L220 was not covered by tests
{
self.interrupts.set_flag(interrupt_bits::CA2);

if self.interrupts.is_enabled(interrupt_bits::CA2) {
active_interrupt = ActiveInterrupt::IRQ;
}

Check warning on line 226 in src/memory/mos652x/via.rs

View check run for this annotation

Codecov / codecov/patch

src/memory/mos652x/via.rs#L222-L226

Added lines #L222 - L226 were not covered by tests
}

Expand All @@ -238,17 +237,16 @@ impl Memory for Via {
}

Check warning on line 237 in src/memory/mos652x/via.rs

View check run for this annotation

Codecov / codecov/patch

src/memory/mos652x/via.rs#L233-L237

Added lines #L233 - L237 were not covered by tests
}

if self.pcr & pcr_control_bits::CB2_DIRECTION != 0 {
if (self.pcr & pcr_control_bits::CB2_INPUT_ACTIVE_TRANSITION == 0
if (self.pcr & pcr_control_bits::CB2_DIRECTION != 0)
&& (self.pcr & pcr_control_bits::CB2_INPUT_ACTIVE_TRANSITION == 0
&& cb2 == ActiveTransition::Rising)

Check warning on line 242 in src/memory/mos652x/via.rs

View check run for this annotation

Codecov / codecov/patch

src/memory/mos652x/via.rs#L241-L242

Added lines #L241 - L242 were not covered by tests
|| (self.pcr & pcr_control_bits::CB2_INPUT_ACTIVE_TRANSITION != 0
&& cb2 == ActiveTransition::Falling)
{
self.interrupts.set_flag(interrupt_bits::CB2);

if self.interrupts.is_enabled(interrupt_bits::CB2) {
active_interrupt = ActiveInterrupt::IRQ;
}
|| (self.pcr & pcr_control_bits::CB2_INPUT_ACTIVE_TRANSITION != 0
&& cb2 == ActiveTransition::Falling)

Check warning on line 244 in src/memory/mos652x/via.rs

View check run for this annotation

Codecov / codecov/patch

src/memory/mos652x/via.rs#L244

Added line #L244 was not covered by tests
{
self.interrupts.set_flag(interrupt_bits::CB2);

if self.interrupts.is_enabled(interrupt_bits::CB2) {
active_interrupt = ActiveInterrupt::IRQ;
}

Check warning on line 250 in src/memory/mos652x/via.rs

View check run for this annotation

Codecov / codecov/patch

src/memory/mos652x/via.rs#L246-L250

Added lines #L246 - L250 were not covered by tests
}

Expand Down

0 comments on commit 69ba92e

Please sign in to comment.