diff --git a/Cargo.lock b/Cargo.lock index 2bc57b3..6d8d5cc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -239,9 +239,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.8" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" +checksum = "40734c41988f7306bb04f0ecf60ec0f3f1caa34290e4e8ea471dcd3346483b83" dependencies = [ "serde", ] @@ -265,38 +265,43 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.20" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd87a5cdd6ffab733b2f74bc4fd7ee5fff6634124999ac278c35fc78c6120148" -dependencies = [ - "serde", - "serde_spanned", - "toml_datetime", - "toml_edit", -] - -[[package]] -name = "toml_datetime" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" -dependencies = [ - "serde", -] - -[[package]] -name = "toml_edit" -version = "0.22.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474" +checksum = "ed0aee96c12fa71097902e0bb061a5e1ebd766a6636bb605ba401c45c1650eac" dependencies = [ "indexmap", "serde", "serde_spanned", "toml_datetime", + "toml_parser", + "toml_writer", "winnow", ] +[[package]] +name = "toml_datetime" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bade1c3e902f58d73d3f294cd7f20391c1cb2fbcb643b73566bc773971df91e3" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_parser" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97200572db069e74c512a14117b296ba0a80a30123fbbb5aa1f4a348f639ca30" +dependencies = [ + "winnow", +] + +[[package]] +name = "toml_writer" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc842091f2def52017664b53082ecbbeb5c7731092bad69d2c63050401dfd64" + [[package]] name = "unicode-ident" version = "1.0.16" @@ -384,9 +389,6 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.7.2" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59690dea168f2198d1a3b0cac23b8063efcd11012f10ae4698f284808c8ef603" -dependencies = [ - "memchr", -] +checksum = "f3edebf492c8125044983378ecb5766203ad3b4c2f7a922bd7dd207f6d443e95" diff --git a/Cargo.toml b/Cargo.toml index c386e5c..a97e5a0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,4 +8,4 @@ clap = { version = "4.5.30", features = ["derive"] } lazy_static = "1.5.0" regex = "1.11.1" serde = { version = "1.0.217", features = ["derive"] } -toml = "0.8.20" +toml = "0.9.2" diff --git a/c_config.toml b/c_config.toml deleted file mode 100644 index 27cd54f..0000000 --- a/c_config.toml +++ /dev/null @@ -1,9 +0,0 @@ - -[general] -target = "test" -main = "main.c" - -[build] -build_dir = "build" -cc = "gcc" -cflags = "-Wall" diff --git a/src/main.rs b/src/main.rs index 7a3bfb3..00b585b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -26,16 +26,6 @@ impl Display for Modes { } } -// impl ToString for Modes { -// fn to_string(&self) -> String { -// match self { -// Modes::Build => "build".to_string(), -// Modes::Clean => "clean".to_string(), -// Modes::Run => "run".to_string(), -// } -// } -// } - #[derive(Parser, Debug)] #[command(author, version, about, long_about = None)] pub struct Args { @@ -61,9 +51,6 @@ fn main() { } else { let conf_path = path::Path::new(args.path.as_str()).join("c_config.toml"); - // let contents = fs::read_to_string(conf_path.clone()) - // .unwrap_or_else(|_| panic!("Couldn't read {}", conf_path.to_str().unwrap())); - let contents = if let Ok(s) = fs::read_to_string(conf_path.clone()) { s } else { @@ -73,13 +60,9 @@ fn main() { let config: Config = toml::from_str(&contents).unwrap(); - // println!("{:?}", config); - let (src_files, header_files) = get_file_list(&args.path).expect("Error while readig files"); - // println!("{:?}, {:?}", src_files, header_files); - compiler = Compiler::new(config, args.path.clone(), src_files, header_files); } diff --git a/test/c_config.toml b/test/c_config.toml deleted file mode 100644 index 5d8eb98..0000000 --- a/test/c_config.toml +++ /dev/null @@ -1,8 +0,0 @@ -[general] -target = "test" -main = "src/main.c" - -[build] -build_dir = "build" -cc = "gcc" -cflags = "-Wall"