From 64858ac87fe13b877682e7b8813c06359e45a0fc Mon Sep 17 00:00:00 2001 From: Oxore Date: Thu, 5 Mar 2020 00:51:20 +0300 Subject: Fix formatting --- src/cpu8051.rs | 8 +++++--- src/main.rs | 6 +++--- src/ram.rs | 4 +--- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/cpu8051.rs b/src/cpu8051.rs index 8702484..c76e9b6 100644 --- a/src/cpu8051.rs +++ b/src/cpu8051.rs @@ -4,9 +4,9 @@ use super::ram::Ram; use super::ram::RAM_OFFSET_ACC; use super::ram::RAM_OFFSET_SP; +use std::cell::RefCell; use std::fmt; use std::rc::Rc; -use std::cell::RefCell; #[derive(Debug, Clone, Copy)] pub enum Opname { @@ -486,7 +486,9 @@ impl Cpu8051 { fn fetch_operand(&self, operand: IncompleteOperand, offset: u16) -> Operand { match operand { IncompleteOperand::Acc => Operand::Acc, - IncompleteOperand::Direct => Operand::Direct(self.progmem.borrow().get(self.pc + offset)), + IncompleteOperand::Direct => { + Operand::Direct(self.progmem.borrow().get(self.pc + offset)) + } IncompleteOperand::Data => Operand::Data(self.progmem.borrow().get(self.pc + offset)), IncompleteOperand::Data16 => Operand::Data16({ let high = self.progmem.borrow().get(self.pc + offset); @@ -586,7 +588,7 @@ impl Cpu8051 { other ), }; - self.extmem.borrow_mut().set(dest as u16 ,value); + self.extmem.borrow_mut().set(dest as u16, value); } fn push(&mut self, operand: Operand) { diff --git a/src/main.rs b/src/main.rs index 5aa3307..cc5b707 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,16 +1,16 @@ extern crate clap; +use std::cell::RefCell; use std::fs; use std::io; use std::io::prelude::*; +use std::rc::Rc; use std::sync::mpsc::{channel, Receiver, Sender}; use std::thread; use std::time::Duration; -use std::rc::Rc; -use std::cell::RefCell; -mod cpu8051; mod bus; +mod cpu8051; mod progmem; mod ram; diff --git a/src/ram.rs b/src/ram.rs index 7027a0e..6278b1c 100644 --- a/src/ram.rs +++ b/src/ram.rs @@ -33,9 +33,7 @@ impl Ram { let mut array = [0; u8::max_value() as usize + 1]; array[RAM_OFFSET_SP as usize] = RESET_VALUE_SP; array[RAM_OFFSET_ACC as usize] = RESET_VALUE_ACC; - Self { - array, - } + Self { array } } } -- cgit v1.2.3