mirror of
https://github.com/AleoHQ/leo.git
synced 2024-12-23 17:43:06 +03:00
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:
parent
b7f2790247
commit
d41c1b7138
@ -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)?;
|
||||
|
||||
|
@ -61,8 +61,7 @@ impl CLI for RunCommand {
|
||||
&prepared_verifying_key,
|
||||
&vec![],
|
||||
&proof,
|
||||
)
|
||||
.unwrap();
|
||||
)?;
|
||||
|
||||
// End the timer
|
||||
let end = start.elapsed().as_millis();
|
||||
|
Loading…
Reference in New Issue
Block a user