Removes a panic

One panic can be folded in the error case of its enclosing `Result`, an `unwrap` call can be elided through pattern-matching reformulation.
This commit is contained in:
François Garillot 2021-01-08 06:05:59 -08:00
parent b7f2790247
commit d41c1b7138
No known key found for this signature in database
GPG Key ID: 7C69FEDBB0E34BA3
2 changed files with 2 additions and 3 deletions

View File

@ -49,7 +49,7 @@ impl<F: Field + PrimeField, G: GroupType<F>> ConstrainedProgram<F, G> {
} else if let Some(value) = self.get(&unresolved_identifier.name) {
// Check imported file scope
value.clone()
} else if expected_type.is_some() && expected_type.unwrap() == Type::Address {
} else if expected_type == Some(Type::Address) {
// If we expect an address type, try to return an address
let address = Address::constant(unresolved_identifier.name, &unresolved_identifier.span)?;

View File

@ -61,8 +61,7 @@ impl CLI for RunCommand {
&prepared_verifying_key,
&vec![],
&proof,
)
.unwrap();
)?;
// End the timer
let end = start.elapsed().as_millis();