diff --git a/conjure_oxide/build.rs b/conjure_oxide/build.rs index 7a160cba83..d3d0b18aa2 100644 --- a/conjure_oxide/build.rs +++ b/conjure_oxide/build.rs @@ -7,7 +7,7 @@ use walkdir::WalkDir; fn main() -> io::Result<()> { let out_dir = var("OUT_DIR").map_err(|e| io::Error::new(io::ErrorKind::Other, e))?; // wrapping in a std::io::Error to match main's error type let dest = Path::new(&out_dir).join("gen_tests.rs"); - let mut f = File::create(&dest)?; + let mut f = File::create(dest)?; let test_dir = "tests/integration"; @@ -45,7 +45,7 @@ fn write_test(file: &mut File, path: String, essence_files: Vec) -> io:: file, include_str!("./tests/gen_test_template"), // TODO: better sanitisation of paths to function names - test_name = path.replace("./", "").replace("/", "_").replace("-", "_"), + test_name = path.replace("./", "").replace(['/', '-'], "_"), test_dir = path, essence_file = essence_files[0] ) diff --git a/conjure_oxide/src/parse.rs b/conjure_oxide/src/parse.rs index 3cfae8e912..1ed89e24a8 100644 --- a/conjure_oxide/src/parse.rs +++ b/conjure_oxide/src/parse.rs @@ -124,7 +124,7 @@ fn parse_int_domain(v: &JsonValue) -> Result { Ok(Domain::IntDomain(ranges)) } -fn parse_constraint(obj: &JsonValue) -> Result<()> { +fn parse_constraint(_obj: &JsonValue) -> Result<()> { Ok(()) } diff --git a/conjure_oxide/src/solvers/minion.rs b/conjure_oxide/src/solvers/minion.rs index de7fef8ddc..9e2f43db59 100644 --- a/conjure_oxide/src/solvers/minion.rs +++ b/conjure_oxide/src/solvers/minion.rs @@ -1,5 +1,6 @@ //! Solver interface to minion_rs. +#[allow(unused_imports)] use anyhow::anyhow; use crate::ast::{ @@ -78,6 +79,7 @@ fn parse_var( let (low, high) = match range { ConjureRange::Bounded(x, y) => Ok((x.to_owned(), y.to_owned())), ConjureRange::Single(x) => Ok((x.to_owned(), x.to_owned())), + #[allow(unreachable_patterns)] x => Err(SolverError::NotSupported(SOLVER, format!("{:?}", x))), }?; diff --git a/conjure_oxide/src/solvers/mod.rs b/conjure_oxide/src/solvers/mod.rs index a0f74d2b13..733306ab94 100644 --- a/conjure_oxide/src/solvers/mod.rs +++ b/conjure_oxide/src/solvers/mod.rs @@ -1,5 +1,5 @@ mod error; pub mod minion; pub use error::*; -mod solvers; -pub use solvers::*; +mod solver_list; +pub use solver_list::*; diff --git a/conjure_oxide/src/solvers/solvers.rs b/conjure_oxide/src/solvers/solver_list.rs similarity index 60% rename from conjure_oxide/src/solvers/solvers.rs rename to conjure_oxide/src/solvers/solver_list.rs index 991142aa3f..b987e7ff6a 100644 --- a/conjure_oxide/src/solvers/solvers.rs +++ b/conjure_oxide/src/solvers/solver_list.rs @@ -1,11 +1,7 @@ -//! All supported solvers. - use strum_macros::Display; use strum_macros::{EnumIter, EnumString}; /// All supported solvers. -/// -/// This enum implements, Display and Iter, so can be used as a string, or iterated over. #[derive(Debug, EnumString, EnumIter, Display)] pub enum Solver { Minion, diff --git a/solvers/chuffed/src/lib.rs b/solvers/chuffed/src/lib.rs index 4e8fc22659..45b17a4a34 100644 --- a/solvers/chuffed/src/lib.rs +++ b/solvers/chuffed/src/lib.rs @@ -1,7 +1,5 @@ pub mod bindings { - #![allow(non_upper_case_globals)] - #![allow(non_camel_case_types)] - #![allow(non_snake_case)] + #![allow(warnings)] include!(concat!(env!("OUT_DIR"), "/chuffed_bindings.rs")); } diff --git a/src/lib.rs b/src/lib.rs deleted file mode 100644 index d9559cebbe..0000000000 --- a/src/lib.rs +++ /dev/null @@ -1,6 +0,0 @@ -pub mod ast; -pub mod error; -pub mod parse; - -pub use ast::Model; -pub use error::Error;