add includes

This commit is contained in:
2020-11-01 21:57:16 +01:00
parent 9d4fef5222
commit 9f289cffd3
16 changed files with 271 additions and 26 deletions
+1 -4
View File
@@ -17,7 +17,6 @@ use crsn_screen::ScreenOps;
use crsn_stdio::StdioOps;
use crsn_buf::BufOps;
mod read_file;
mod serde_duration_millis;
#[derive(Debug, Clone, Serialize, Deserialize)]
@@ -167,11 +166,9 @@ fn main() -> anyhow::Result<()> {
debug!("Loading {}", config.program_file);
let source = read_file::read_file(&config.program_file)?;
let uniq = CrsnUniq::new();
let parsed = crsn::asm::assemble(&source, &uniq, vec![
let parsed = crsn::asm::assemble(&config.program_file, &uniq, vec![
ArithOps::new(),
BufOps::new(),
ScreenOps::new(),
-14
View File
@@ -1,14 +0,0 @@
use std::fs::File;
use std::io;
use std::io::Read;
use std::path::Path;
/// Read a file to string
pub fn read_file<P: AsRef<Path>>(path: P) -> io::Result<String> {
let path = path.as_ref();
let mut file = File::open(path)?;
let mut buf = String::new();
file.read_to_string(&mut buf)?;
Ok(buf)
}