mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-04-25 15:19:58 -07:00
global: more mining related datasets
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user