Skip to content

Commit

Permalink
fix some clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasdewally committed Nov 21, 2023
1 parent 07238e4 commit 983eaf0
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 18 deletions.
4 changes: 2 additions & 2 deletions conjure_oxide/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -45,7 +45,7 @@ fn write_test(file: &mut File, path: String, essence_files: Vec<String>) -> 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]
)
Expand Down
2 changes: 1 addition & 1 deletion conjure_oxide/src/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ fn parse_int_domain(v: &JsonValue) -> Result<Domain> {
Ok(Domain::IntDomain(ranges))
}

fn parse_constraint(obj: &JsonValue) -> Result<()> {
fn parse_constraint(_obj: &JsonValue) -> Result<()> {
Ok(())
}

Expand Down
2 changes: 2 additions & 0 deletions conjure_oxide/src/solvers/minion.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//! Solver interface to minion_rs.

#[allow(unused_imports)]
use anyhow::anyhow;

use crate::ast::{
Expand Down Expand Up @@ -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))),
}?;

Expand Down
4 changes: 2 additions & 2 deletions conjure_oxide/src/solvers/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
mod error;
pub mod minion;
pub use error::*;
mod solvers;
pub use solvers::*;
mod solver_list;
pub use solver_list::*;
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
4 changes: 1 addition & 3 deletions solvers/chuffed/src/lib.rs
Original file line number Diff line number Diff line change
@@ -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"));
}

Expand Down
6 changes: 0 additions & 6 deletions src/lib.rs

This file was deleted.

0 comments on commit 983eaf0

Please sign in to comment.