Skip to content

Commit

Permalink
feat: sort credentials output alphabetically
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianbenavides committed Jan 6, 2025
1 parent 6a4d371 commit d127106
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,9 @@ impl Output for ProjectEnrollOutput {
"The following attributes are attested by the project's membership authority:"
)
)?;
for (k, v) in credential.attributes.iter() {
let mut attributes = credential.attributes.iter().collect::<Vec<_>>();
attributes.sort();
for (k, v) in attributes.iter() {
writeln!(
f,
"{}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ impl Command for TicketCommand {
} else {
let mut attributes_msg =
fmt_log!("The redeemer will be assigned the following attributes:\n");

let mut attributes: Vec<_> = attributes.iter().collect();
attributes.sort();
for (key, value) in &attributes {
attributes_msg += &fmt_log!(
"{}{}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ impl AttributesEntry {
attributes.push(format!("{k}={v}"));
}
}
attributes.sort();
attributes
}

Expand Down

0 comments on commit d127106

Please sign in to comment.