Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(snapshot): sort selectors ascending #184

Merged

Conversation

iankressin
Copy link
Contributor

Motivation

This PR fixes Issue #178

Solution

  • I first create a vector sorted_snapshots from the relevant slice of snapshots.
  • Then, I sort sorted_snapshots in place using sort_by.
  • Finally, I iterate over sorted_snapshots to build the rows.

I could have implement Ord trait for Snapshot , but it seemed an overkill to me, as this is the only place in the codebase so far that requires such ordering. Once new sorting cases appears, the trait approach must be more suitable.

Demo
image

@Jon-Becker Jon-Becker changed the title Feat/sort selectors on snapshot feat(snapshot): sort selectors ascending Nov 19, 2023
Copy link
Owner

@Jon-Becker Jon-Becker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Once CI passes, i'll merge this into main. Thank you so much for your contribution!

@Jon-Becker Jon-Becker linked an issue Nov 19, 2023 that may be closed by this pull request
@Jon-Becker Jon-Becker merged commit 62a2ba0 into Jon-Becker:main Nov 19, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

deterministic ordering of snapshot selectors
2 participants