From ff885c4d5dd51b25a793b6727d2f5172971fbf66 Mon Sep 17 00:00:00 2001 From: Srinath Setty Date: Thu, 14 Oct 2021 16:52:13 -0700 Subject: [PATCH] fix bellperson path; address minor clippy-suggested edit --- Cargo.toml | 2 +- src/bellperson/shape_cs.rs | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 39061a4..301eaa0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ license-file = "LICENSE" keywords = ["zkSNARKs", "cryptography", "proofs"] [dependencies] -bellperson = { git = "https://github.com/filecoin-project/bellperson", branch = "nova-minimal" } +bellperson = { git = "https://github.com/filecoin-project/bellperson" } ff = "0.11.0" merlin = "2.0.0" rand = "0.8.4" diff --git a/src/bellperson/shape_cs.rs b/src/bellperson/shape_cs.rs index 2e07a07..8b5dfe9 100644 --- a/src/bellperson/shape_cs.rs +++ b/src/bellperson/shape_cs.rs @@ -160,7 +160,7 @@ where let pp = |s: &mut String, lc: &LinearCombination| { s.push('('); let mut is_first = true; - for (var, coeff) in proc_lc::(&lc) { + for (var, coeff) in proc_lc::(lc) { if coeff == negone { s.push_str(" - ") } else if !is_first { @@ -213,9 +213,7 @@ where /// TODO: document fn set_named_obj(&mut self, path: String, to: NamedObject) { - if self.named_objects.contains_key(&path) { - panic!("tried to create object at existing path: {}", path); - } + assert!(!self.named_objects.contains_key(&path), "tried to create object at existing path: {}", path); self.named_objects.insert(path, to); } @@ -308,9 +306,7 @@ where } fn compute_path(ns: &[String], this: &str) -> String { - if this.chars().any(|a| a == '/') { - panic!("'/' is not allowed in names"); - } + assert!(!this.chars().any(|a| a == '/'), "'/' is not allowed in names"); let mut name = String::new();