summaryrefslogtreecommitdiffstats
path: root/cli/src/store.rs
diff options
context:
space:
mode:
authorGustav Sörnäs <gustav@sornas.net>2021-07-29 16:41:29 +0200
committerGustav Sörnäs <gustav@sornas.net>2021-07-29 16:41:29 +0200
commit0e2f1896ef8a2e4e85b4bf5e4d97f4bc8a032676 (patch)
tree9d80a2ff1361cb1bcfecd382312308386c6a5dbb /cli/src/store.rs
parent750ac56977cd08d850cf902c8c8070512ecf484f (diff)
downloadmoney-0e2f1896ef8a2e4e85b4bf5e4d97f4bc8a032676.tar.gz
sort store by date
Diffstat (limited to 'cli/src/store.rs')
-rw-r--r--cli/src/store.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/cli/src/store.rs b/cli/src/store.rs
index 4e0e36b..6d20022 100644
--- a/cli/src/store.rs
+++ b/cli/src/store.rs
@@ -49,13 +49,13 @@ impl Store {
Ok(())
}
- pub fn transactions(&self) -> &[Transaction] {
- &self.transactions
+ pub fn transactions(&self) -> Vec<&Transaction> {
+ self.transactions.iter().collect()
}
pub fn categories(&self) -> Vec<Category> {
let mut categories: Vec<_> = self
- .transactions()
+ .transactions
.iter()
.map(|t| t.category.clone())
.collect();