summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/main.rs b/src/main.rs
index f5dd8c1..d588823 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -2,10 +2,10 @@ use std::env;
use std::fs;
use std::io;
use std::io::prelude::*;
-use std::{thread, time};
-use std::thread::sleep;
-use std::sync::{Arc, Mutex, Condvar};
use std::string::String;
+use std::sync::{Arc, Condvar, Mutex};
+use std::thread::sleep;
+use std::{thread, time};
mod core;
mod ram;
@@ -34,13 +34,13 @@ fn cli_controller(asyncpair: Arc<(Mutex<bool>, Condvar)>) {
"stop" => {
println!("stop");
*should_stop.lock().unwrap() = true;
- },
+ }
"start" => {
println!("start");
*should_stop.lock().unwrap() = false;
cvar.notify_one();
- },
- _ => ()
+ }
+ _ => (),
}
}
}
@@ -51,18 +51,17 @@ fn main() {
println!("Please, specify ihex file");
return;
}
- let data = fs::read_to_string(&args[1])
- .expect(&format!("Unable to read file {}", &args[1]));
+ let data = fs::read_to_string(&args[1]).expect(&format!("Unable to read file {}", &args[1]));
let asyncpair = Arc::new((Mutex::new(false), Condvar::new()));
let asyncpair2 = asyncpair.clone();
- let core = match Core::with_ram_from_hex(String::from(data)) {
+ let core = match Core::new_with_ram_from_hex(String::from(data)) {
Ok(value) => value,
Err(err_string) => {
println!("{}", err_string);
return;
- },
+ }
};
println!("{}", core.op());