Fix wrong assertion of program args
This commit is contained in:
parent
f132c9fbea
commit
016e5e1caa
2 changed files with 2 additions and 3 deletions
1
build.rs
1
build.rs
|
@ -8,7 +8,6 @@ fn main() {
|
|||
.include("lib/libsnark/include/libsnark")
|
||||
.flag("-std=c++11")
|
||||
.define("CURVE_BN128", None)
|
||||
// .define("DEBUG", None)
|
||||
.file("lib/wraplibsnark.cpp")
|
||||
.compile("libwraplibsnark.a");
|
||||
}
|
||||
|
|
|
@ -71,7 +71,7 @@ fn parse_program(file: File) -> Prog {
|
|||
};
|
||||
break;
|
||||
},
|
||||
Some(Ok(ref x)) if x.starts_with("//") || x == "" => {},
|
||||
Some(Ok(ref x)) if x.trim().starts_with("//") || x == "" => {},
|
||||
None => panic!("End of file reached without function def"),
|
||||
Some(x) => panic!("Found '{:?}' outside of function", x),
|
||||
}
|
||||
|
@ -343,7 +343,7 @@ fn r1cs_program(prog: &Prog) -> (Vec<String>, Vec<Vec<(usize, i32)>>, Vec<Vec<(u
|
|||
|
||||
fn main() {
|
||||
let args: Vec<_> = std::env::args().collect();
|
||||
assert!(args.len() == 2|3);
|
||||
assert!(args.len() == 2 || args.len() == 3);
|
||||
|
||||
let path = Path::new(&args[1]);
|
||||
let file = match File::open(&path) {
|
||||
|
|
Loading…
Reference in a new issue