Skip to content

Commit

Permalink
set the purpose of the input descriptor if constraint field purpose d…
Browse files Browse the repository at this point in the history
…oes not exist (#47)

Signed-off-by: Ryan Tate <[email protected]>
  • Loading branch information
Ryanmtate authored Dec 20, 2024
1 parent e238bc1 commit 468faff
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/core/input_descriptor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,15 @@ impl InputDescriptor {
.fields
.iter()
.map(|field| field.requested_fields(self.id.clone(), value))
.map(|mut requested_field| {
// Set the purpose of the requested field to the input descriptor `purpose`,
// if it is no value is set from the constraint field's `purpose`.
if requested_field.purpose.is_none() {
requested_field.purpose = self.purpose.clone();
}

requested_field
})
.collect()
}

Expand Down

0 comments on commit 468faff

Please sign in to comment.