Browse Source

Make clippy happier

Ian Goldberg 4 months ago
parent
commit
3247addd99
1 changed files with 6 additions and 7 deletions
  1. 6 7
      sigma_compiler_core/src/rangeproof.rs

+ 6 - 7
sigma_compiler_core/src/rangeproof.rs

@@ -236,13 +236,12 @@ pub fn transform(
     let pedersens: HashMap<Ident, PedersenAssignment> = leaves
         .iter()
         .filter_map(|leafexpr| {
-            if let Some(ped_assign) =
-                recognize_pedersen_assignment(vars, &randoms, &vardict, leafexpr)
-            {
-                Some((ped_assign.var(), ped_assign))
-            } else {
-                None
-            }
+            // See if we recognize this leaf expression as a
+            // PedersenAssignment, and if so, make a pair mapping its
+            // variable to the PedersenAssignment.  (The "collect()"
+            // will turn the list of pairs into a HashMap.)
+            recognize_pedersen_assignment(vars, &randoms, &vardict, leafexpr)
+                .map(|ped_assign| (ped_assign.var(), ped_assign))
         })
         .collect();