cargo clippy --fix
This commit is contained in:
parent
f1a5d13830
commit
4e4b92abf2
@ -41,7 +41,7 @@ impl Chip {
|
|||||||
Self {
|
Self {
|
||||||
log: log.clone(),
|
log: log.clone(),
|
||||||
cpu: CPU::new(log),
|
cpu: CPU::new(log),
|
||||||
rom: rom,
|
rom,
|
||||||
device_tree: dev_tree,
|
device_tree: dev_tree,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -54,14 +54,14 @@ impl fmt::Display for CPU {
|
|||||||
write!(f, "-")?;
|
write!(f, "-")?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
write!(f, "\n")?;
|
writeln!(f)?;
|
||||||
for i in 0..32 {
|
for i in 0..32 {
|
||||||
write!(f, " R{:-2}={:02X} ", i, self.registers[i])?;
|
write!(f, " R{:-2}={:02X} ", i, self.registers[i])?;
|
||||||
if (i + 1) % 10 == 0 {
|
if (i + 1) % 10 == 0 {
|
||||||
write!(f, "\n")?;
|
writeln!(f)?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
write!(f, "\n")
|
writeln!(f)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -71,7 +71,7 @@ impl CPU {
|
|||||||
registers: [0u8; 32],
|
registers: [0u8; 32],
|
||||||
pc: 0, // Reset vector
|
pc: 0, // Reset vector
|
||||||
sreg: 0, // Uninitialized as well
|
sreg: 0, // Uninitialized as well
|
||||||
logger: logger,
|
logger,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -22,9 +22,9 @@ pub struct Device {
|
|||||||
impl Device {
|
impl Device {
|
||||||
pub fn new(device: Box<dyn DeviceImpl>, start_addr: u32, addr_len: u32) -> Self {
|
pub fn new(device: Box<dyn DeviceImpl>, start_addr: u32, addr_len: u32) -> Self {
|
||||||
Self {
|
Self {
|
||||||
start_addr: start_addr,
|
start_addr,
|
||||||
addr_len: addr_len,
|
addr_len,
|
||||||
device: device,
|
device,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -49,7 +49,7 @@ pub struct DeviceTree {
|
|||||||
impl DeviceTree {
|
impl DeviceTree {
|
||||||
pub fn new(log: Logger) -> Self {
|
pub fn new(log: Logger) -> Self {
|
||||||
Self {
|
Self {
|
||||||
log: log,
|
log,
|
||||||
devices: Vec::new(),
|
devices: Vec::new(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -40,7 +40,7 @@ pub struct Oscillator {
|
|||||||
impl Oscillator {
|
impl Oscillator {
|
||||||
pub fn new(log: Logger) -> Self {
|
pub fn new(log: Logger) -> Self {
|
||||||
Self {
|
Self {
|
||||||
log: log,
|
log,
|
||||||
reg_values: [0u8; 7],
|
reg_values: [0u8; 7],
|
||||||
|
|
||||||
ctrl: 0,
|
ctrl: 0,
|
||||||
|
|||||||
@ -10,7 +10,7 @@ pub struct RAM {
|
|||||||
impl RAM {
|
impl RAM {
|
||||||
pub fn new(log: Logger) -> Self {
|
pub fn new(log: Logger) -> Self {
|
||||||
Self {
|
Self {
|
||||||
log: log,
|
log,
|
||||||
data: Box::new([0u8; 0x4000]),
|
data: Box::new([0u8; 0x4000]),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -34,7 +34,7 @@ pub struct USART {
|
|||||||
impl USART {
|
impl USART {
|
||||||
pub fn new(log: Logger) -> Self {
|
pub fn new(log: Logger) -> Self {
|
||||||
Self {
|
Self {
|
||||||
log: log,
|
log,
|
||||||
status: 0,
|
status: 0,
|
||||||
ctrla: 0,
|
ctrla: 0,
|
||||||
ctrlb: 0,
|
ctrlb: 0,
|
||||||
|
|||||||
@ -184,8 +184,8 @@ impl<'a> GDBStub<'a> {
|
|||||||
|
|
||||||
pub fn new(log: slog::Logger, chip: &'a mut chip::Chip) -> Self {
|
pub fn new(log: slog::Logger, chip: &'a mut chip::Chip) -> Self {
|
||||||
Self {
|
Self {
|
||||||
log: log,
|
log,
|
||||||
chip: chip,
|
chip,
|
||||||
breakpoints: HashSet::new(),
|
breakpoints: HashSet::new(),
|
||||||
watchpoints_read: HashSet::new(),
|
watchpoints_read: HashSet::new(),
|
||||||
watchpoints_write: HashSet::new(),
|
watchpoints_write: HashSet::new(),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user