aboutsummaryrefslogtreecommitdiff
path: root/src/bill.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/bill.rs')
-rw-r--r--src/bill.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/bill.rs b/src/bill.rs
index 4b66554..291b759 100644
--- a/src/bill.rs
+++ b/src/bill.rs
@@ -235,4 +235,19 @@ impl Bills {
bills
}
+
+ pub fn get_members(&self) -> Vec<String> {
+ let mut members = std::collections::HashSet::new();
+
+ for item in self.items.values() {
+ members.insert(item.who_paid.to_string());
+ for who in &item.split {
+ members.insert(who.to_string());
+ }
+ }
+
+ let mut result: Vec<String> = members.into_iter().collect();
+ result.sort();
+ result
+ }
}