RevolutTransactions struct and TransactionAccumulator - #158
Merged
Conversation
Keep logic unchanged Create RevolutTransactions struct instead of tuple add empty crypto_transactions field
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the Revolut CSV parser by replacing the unstructured tuple return with a named RevolutTransactions struct, introduces a TransactionAccumulator to consolidate repeated vector parameters, and adds an empty crypto_transactions field for future use.
- Grouped seven related vectors into
TransactionAccumulator - Replaced the old tuple return of
parse_revolut_transactionswith theRevolutTransactionsstruct - Added an empty
crypto_transactionsfield in both the public API and internal logic
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/lib.rs | Updated call site to destructure the new RevolutTransactions struct instead of a tuple |
| src/csvparser.rs | Introduced TransactionAccumulator and RevolutTransactions, changed parse_revolut_transactions signature and body to use those types |
Comments suppressed due to low confidence (2)
src/csvparser.rs:19
- [nitpick] Add a Rustdoc comment for
TransactionAccumulatorexplaining its role in consolidating parsing state and supporting future extensions.
struct TransactionAccumulator {
src/csvparser.rs:449
- [nitpick] Consider renaming the local variable
tato something more descriptive likeaccumulatorortx_accumulatorto clarify its purpose.
let mut ta = TransactionAccumulator::default();
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Collaborator
|
good job! |
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.
Keep logic unchanged
Create TransactionAccumulator struct to group commonly used together 7 vectors
Create RevolutTransactions struct instead of a tuple to name returned fields from parse_revolut_transactions
add empty crypto_transactions field
Next, I will separate crypto into crypto_transactions
@jczaja please share your thoughts before I continue