diff --git a/src/lib.rs b/src/lib.rs index 2841fae..24df1ea 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -19,8 +19,7 @@ mod value; pub mod vm; pub mod errors; -pub fn compile_sourcedir(source_dir:&str)-> Result<(Vec, HashMap), Error>{ - let mut paths = vec![]; +pub fn compile_sourcedir(source_dir:&str)-> Result, Error>{ let mut registry = HashMap::new(); for entry in WalkDir::new(source_dir).into_iter().filter_map(|e| e.ok()) { @@ -36,7 +35,6 @@ pub fn compile_sourcedir(source_dir:&str)-> Result<(Vec, HashMap { println!("{}", e); @@ -46,7 +44,7 @@ pub fn compile_sourcedir(source_dir:&str)-> Result<(Vec, HashMap fn(std::io::Error) -> Error { diff --git a/src/main.rs b/src/main.rs index e70edd7..6db0559 100644 --- a/src/main.rs +++ b/src/main.rs @@ -13,10 +13,10 @@ use std::sync::Arc; async fn main() -> Result<(), crudlang::errors::Error> { tracing_subscriber::fmt::init(); - let (paths,registry) = compile_sourcedir("source")?; + let registry = compile_sourcedir("source")?; let registry = Arc::new(registry); - if !paths.is_empty() { + if !registry.is_empty() { let state = Arc::new(AppState { registry: registry.clone(), });