global: more mining related datasets

This commit is contained in:
nym21
2025-09-11 18:45:54 +02:00
parent 47f7cef4f4
commit 6253fa30ef
5 changed files with 222 additions and 124 deletions

View File

@@ -1,6 +1,7 @@
use std::{
cmp::Ordering,
f64,
iter::Sum,
ops::{Add, AddAssign, Div, Mul},
};
@@ -378,3 +379,10 @@ impl Ord for Dollars {
}
}
}
impl Sum for Dollars {
fn sum<I: Iterator<Item = Self>>(iter: I) -> Self {
let dollars: f64 = iter.map(|dollars| dollars.0).sum();
Self::from(dollars)
}
}