Conversation
This means we're not creating vectors unnecessarily.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #139 +/- ##
==========================================
- Coverage 80.36% 78.85% -1.52%
==========================================
Files 10 10
Lines 163 175 +12
==========================================
+ Hits 131 138 +7
- Misses 32 37 +5 ☔ View full report in Codecov by Sentry. |
Collaborator
Author
|
Actually, maybe hold off on reviewing this for now. I've thought of (what might be) a simpler way of doing things |
Collaborator
Author
|
It turned out to be a less simple idea than I thought 😛. I think this is good to go! |
Collaborator
Author
|
@tsmbland has signed off on this verbally, so I'm just going to go ahead and merge. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This PR moves various bits of code out of
process.rsand makes them more generic so that they can be used by other modules (e.g. it will be useful for the commodities code).I've introduced a couple of changes to how things were implemented too:
Rc<str>(reference counted strings) for ID values in many places. We end up using a lot of strings as the various process-related input files are read intoHashMaps with IDs as strings and we want to avoid copying them as much as possible. An alternative is to use references with appropriate lifetimes but this is a bit more finnicky and doesn't always work (e.g. you can't have a key that refers to a field in the value of the same map).Vec), which makes the code cleaner and more composable. Some of this has involved writing traits, which seemed odd to me at first, but I think the result is much nicer.I also fixed #137 while I was at it.
Fixes #137.
Type of change
Key checklist
$ cargo test$ cargo docFurther checks