Skip to content

Commit

Permalink
use Certificate::from instead of try_from
Browse files Browse the repository at this point in the history
  • Loading branch information
ecioppettini committed Dec 23, 2021
1 parent 82407fd commit 217e2e7
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions explorer/src/api/graphql/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -877,11 +877,9 @@ impl Transaction {
&self,
context: &Context<'_>,
) -> FieldResult<Option<certificates::Certificate>> {
let transaction = self.get_contents(context).await?;
match transaction.certificate {
Some(c) => Certificate::try_from(c).map(Some).map_err(|e| e.into()),
None => Ok(None),
}
self.get_contents(context)
.await
.map(|transaction| transaction.certificate.map(Certificate::from))
}
}

Expand Down

0 comments on commit 217e2e7

Please sign in to comment.