This repository was archived by the owner on Oct 17, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 7
Fix subsubtable order #9
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gaborbernat
suggested changes
May 12, 2024
Member
gaborbernat
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're supposed to keep the file order for these not reorder them lexicographic-ly.
gaborbernat
reviewed
May 13, 2024
Cargo.toml
Outdated
| pep508_rs = { version = "0.5.0" } | ||
| lexical-sort = { version = "0.3.1" } | ||
| regex = { version = "1.10.4" } | ||
| indexmap = "2.2.6" |
Member
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need an external package to solve this?
gaborbernat
reviewed
May 13, 2024
gaborbernat
suggested changes
May 13, 2024
rust/src/helpers/table.rs
Outdated
| let mut order: Vec<String> = header_to_pos.clone().into_keys().collect(); | ||
| // order headers by pos | ||
| let mut header_pos: Vec<(String, usize)> = header_to_pos.clone().into_iter().collect(); | ||
| header_pos.sort_by_key(|&(_, v)| v); |
Member
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than sorting twice, can we just somehow append the position inside the store that happens immediately after this, that would be a better solution. Having two sorts make it look a bit suboptimal.
gaborbernat
approved these changes
May 13, 2024
Contributor
Author
|
thanks! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is to fix sort order among subtables, e.g. "tool.coverage.paths", "tool.coverage.report" and "tool.coverage.run".
Pls refer to the issue: #8 for details.