diff --git a/Cargo.toml b/Cargo.toml index ee01200..e248c8a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,6 +9,10 @@ resolver = "2" [workspace.dependencies] clap = { version = "4", features = [ "derive" ] } +# to enable all the lints below, this must be present in a workspace member's Cargo.toml: +# [lints] +# workspace = true + [workspace.lints.rust] unsafe_code = "deny" variant_size_differences = "warn" diff --git a/crates/executor/Cargo.toml b/crates/executor/Cargo.toml index fc01c27..49d9685 100644 --- a/crates/executor/Cargo.toml +++ b/crates/executor/Cargo.toml @@ -9,3 +9,6 @@ edition = "2021" clap = { workspace = true, features = [ "derive" ] } image = "0.24" rpl = { path = "../rpl" } + +[lints] +workspace = true diff --git a/crates/executor/src/debug/instructions/mod.rs b/crates/executor/src/debug/instructions/mod.rs index 0bbbfaa..7fa5531 100644 --- a/crates/executor/src/debug/instructions/mod.rs +++ b/crates/executor/src/debug/instructions/mod.rs @@ -2,7 +2,7 @@ pub mod read { use image::{io::Reader as ImageReader, DynamicImage}; use rpl::instructions::read::{Read, SourceType}; - pub fn read(Read { source, format: _ }: Read) -> DynamicImage { + pub fn read(Read { source, .. }: Read) -> DynamicImage { // TODO: actual error handling let img = ImageReader::open(match source { SourceType::File(path) => path, diff --git a/crates/pl-cli/Cargo.toml b/crates/pl-cli/Cargo.toml index e6f8cc8..4dc900e 100644 --- a/crates/pl-cli/Cargo.toml +++ b/crates/pl-cli/Cargo.toml @@ -9,3 +9,6 @@ edition = "2021" clap = { workspace = true, features = [ "derive" ] } rpl = { path = "../rpl" } executor = { path = "../executor" } + +[lints] +workspace = true diff --git a/crates/pl-cli/src/main.rs b/crates/pl-cli/src/main.rs index 9e84d33..4c82336 100644 --- a/crates/pl-cli/src/main.rs +++ b/crates/pl-cli/src/main.rs @@ -12,7 +12,8 @@ pub struct Args { fn main() { let args = dbg!(Args::parse()); - let f = fs::read_to_string(args.file).unwrap(); + let f = fs::read_to_string(args.file) + .expect("reading IR failed — come back to this later handle errors properly"); let pl = rpl::from_ron(&f); execute_all(pl.0); diff --git a/crates/rpl/Cargo.toml b/crates/rpl/Cargo.toml index e406f11..9fb8505 100644 --- a/crates/rpl/Cargo.toml +++ b/crates/rpl/Cargo.toml @@ -8,3 +8,6 @@ edition = "2021" [dependencies] serde = { version = "1.0.193", features = [ "derive" ] } ron = "0.8" + +[lints] +workspace = true