Skip to content

Commit

Permalink
Adjust to latest changes in flatzinc
Browse files Browse the repository at this point in the history
  • Loading branch information
sthiele committed Dec 6, 2023
1 parent 5a66290 commit 0b26c43
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 3 additions & 11 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use flatzinc::*;
use log::warn;
use std::io::Write;
use thiserror::Error;
use flatzinc::ContextError;

#[derive(Error, Debug)]
pub enum FlatZincError {
Expand Down Expand Up @@ -332,11 +331,11 @@ fn test_constraints() {
}
pub fn write_fz_stmt(
mut out: impl Write,
mut input: &str,
input: &str,
constraint_counter: &mut usize,
level: &mut i32,
) -> Result<()> {
match flatzinc::parse_statement::<ContextError<&str>>(&mut input) {
match <Stmt as std::str::FromStr>::from_str(input) {
Ok(stmt) => {
match stmt {
Stmt::Comment(s) => {
Expand Down Expand Up @@ -383,14 +382,7 @@ pub fn write_fz_stmt(
}
Ok(())
}
// Err(Err::Error(e)) | Err(Err::Failure(e)) => {
// let msg = convert_error(input, e);
// Err(FlatZincError::ParseError { msg }.into())
// }
Err(e) => Err(FlatZincError::ParseError {
msg: format!("{e}"),
}
.into()),
Err(msg) => Err(FlatZincError::ParseError { msg }.into()),
}
}

Expand Down

0 comments on commit 0b26c43

Please sign in to comment.