mirror of
https://github.com/AleoHQ/leo.git
synced 2024-12-19 15:41:36 +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) {
|
} else if let Some(value) = self.get(&unresolved_identifier.name) {
|
||||||
// Check imported file scope
|
// Check imported file scope
|
||||||
value.clone()
|
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
|
// If we expect an address type, try to return an address
|
||||||
let address = Address::constant(unresolved_identifier.name, &unresolved_identifier.span)?;
|
let address = Address::constant(unresolved_identifier.name, &unresolved_identifier.span)?;
|
||||||
|
|
||||||
|
@ -61,8 +61,7 @@ impl CLI for RunCommand {
|
|||||||
&prepared_verifying_key,
|
&prepared_verifying_key,
|
||||||
&vec![],
|
&vec![],
|
||||||
&proof,
|
&proof,
|
||||||
)
|
)?;
|
||||||
.unwrap();
|
|
||||||
|
|
||||||
// End the timer
|
// End the timer
|
||||||
let end = start.elapsed().as_millis();
|
let end = start.elapsed().as_millis();
|
||||||
|
Loading…
Reference in New Issue
Block a user