Satisfy clippy

old-bit-manip
Nick Krichevsky 2023-06-17 14:45:53 -04:00
parent 915f33307e
commit 95e07a2b56
2 changed files with 5 additions and 4 deletions

View File

@ -13,11 +13,11 @@ use crate::{
use super::{OperationFlagOutput, OperationOutput};
pub fn run_add(processor: &mut Processor, operand: Operand) -> Result<(), Error> {
run_operation(processor, operand, |lhs, rhs| run_add_on_operands(lhs, rhs))
run_operation(processor, operand, run_add_on_operands)
}
pub fn run_add_with_carry(processor: &mut Processor, operand: Operand) -> Result<(), Error> {
run_operation_with_carry(processor, operand, |lhs, rhs| run_add_on_operands(lhs, rhs))
run_operation_with_carry(processor, operand, run_add_on_operands)
}
fn run_add_on_operands<T>(lhs: u8, rhs: T) -> OperationOutput
@ -33,11 +33,11 @@ where
}
pub fn run_sub(processor: &mut Processor, operand: Operand) -> Result<(), Error> {
run_operation(processor, operand, |lhs, rhs| run_sub_on_operands(lhs, rhs))
run_operation(processor, operand, run_sub_on_operands)
}
pub fn run_sub_with_carry(processor: &mut Processor, operand: Operand) -> Result<(), Error> {
run_operation_with_carry(processor, operand, |lhs, rhs| run_sub_on_operands(lhs, rhs))
run_operation_with_carry(processor, operand, run_sub_on_operands)
}
fn run_sub_on_operands<T>(lhs: u8, rhs: T) -> OperationOutput

View File

@ -43,6 +43,7 @@ where
}
/// Get the number and its carry bit directly
#[allow(dead_code)] // I think this is valuable to have in a public interface
pub fn raw_values(self) -> (N, u8) {
(self.num, self.carry_bit)
}