add includes
This commit is contained in:
@@ -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(),
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
Reference in New Issue
Block a user