Skip to content

Commit

Permalink
fix clippy errors
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Tate <ryan.michael.tate@gmail.com>
  • Loading branch information
Ryanmtate committed Sep 2, 2024
1 parent ecc17e4 commit 0686361
Showing 1 changed file with 13 additions and 23 deletions.
36 changes: 13 additions & 23 deletions src/core/input_descriptor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -635,33 +635,23 @@ impl ConstraintsField {
{
// Check the filter field to determine the `const`
// value for the credential type, e.g. `iso.org.18013.5.1.mDL`, etc.
if let Some(credential) = self
.filter
.as_ref()
.map(|filter| {
filter
.get("const")
.and_then(Value::as_str)
.map(CredentialType::from)
})
.flatten()
{
if let Some(credential) = self.filter.as_ref().and_then(|filter| {
filter
.get("const")
.and_then(Value::as_str)
.map(CredentialType::from)
}) {
return Some(credential);
}

// The `type` field may be an array with a nested const value.
if let Some(credential) = self
.filter
.as_ref()
.map(|filter| {
filter
.get("contains")
.and_then(|value| value.get("const"))
.and_then(Value::as_str)
.map(CredentialType::from)
})
.flatten()
{
if let Some(credential) = self.filter.as_ref().and_then(|filter| {
filter
.get("contains")
.and_then(|value| value.get("const"))
.and_then(Value::as_str)
.map(CredentialType::from)
}) {
return Some(credential);
}
}
Expand Down

0 comments on commit 0686361

Please sign in to comment.