Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/transactions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub use crate::logging::ResultExt;
use crate::{SoldTransaction, Transaction};

/// Check if all interests rate transactions come from the same year
pub fn verify_interests_transactions<T>(transactions: &Vec<(String, T, T)>) -> Result<(), String> {
pub fn verify_interests_transactions<T>(transactions: &[(String, T, T)]) -> Result<(), String> {
Copy link

Copilot AI Apr 18, 2026

Choose a reason for hiding this comment

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

The PR title suggests a general move away from &Vec<T> in function signatures, but src/transactions.rs still contains public functions taking &Vec<...> (e.g., reconstruct_sold_transactions) and src/lib.rs has &Vec<...> params as well. Consider updating the remaining signatures to slices (&[...]) in this PR or adjusting the PR scope/title so the change is consistent and expectations are clear.

Copilot uses AI. Check for mistakes.
let mut trans = transactions.iter();
let transaction_date = match trans.next() {
Some((x, _, _)) => x,
Expand Down Expand Up @@ -39,7 +39,7 @@ pub fn verify_interests_transactions<T>(transactions: &Vec<(String, T, T)>) -> R

/// Check if all dividends transaction come from the same year
pub fn verify_dividends_transactions<T>(
div_transactions: &Vec<(String, T, T, Option<String>)>,
div_transactions: &[(String, T, T, Option<String>)],
) -> Result<(), String> {
let mut trans = div_transactions.iter();
let transaction_date = match trans.next() {
Expand Down Expand Up @@ -68,7 +68,7 @@ pub fn verify_dividends_transactions<T>(
}

pub fn verify_transactions<T>(
transactions: &Vec<(String, String, T, T, Option<String>)>,
transactions: &[(String, String, T, T, Option<String>)],
) -> Result<(), String> {
let mut trans = transactions.iter();
let transaction_date = match trans.next() {
Expand Down
Loading