Merge pull request #651 from LNP-BP/fix/amount-sum-nostd
This commit is contained in:
commit
9710728d89
|
@ -523,7 +523,7 @@ impl FromStr for Amount {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ::std::iter::Sum for Amount {
|
impl ::core::iter::Sum for Amount {
|
||||||
fn sum<I: Iterator<Item=Self>>(iter: I) -> Self {
|
fn sum<I: Iterator<Item=Self>>(iter: I) -> Self {
|
||||||
let sats: u64 = iter.map(|amt| amt.0).sum();
|
let sats: u64 = iter.map(|amt| amt.0).sum();
|
||||||
Amount::from_sat(sats)
|
Amount::from_sat(sats)
|
||||||
|
@ -855,7 +855,7 @@ impl FromStr for SignedAmount {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ::std::iter::Sum for SignedAmount {
|
impl ::core::iter::Sum for SignedAmount {
|
||||||
fn sum<I: Iterator<Item=Self>>(iter: I) -> Self {
|
fn sum<I: Iterator<Item=Self>>(iter: I) -> Self {
|
||||||
let sats: i64 = iter.map(|amt| amt.0).sum();
|
let sats: i64 = iter.map(|amt| amt.0).sum();
|
||||||
SignedAmount::from_sat(sats)
|
SignedAmount::from_sat(sats)
|
||||||
|
|
Loading…
Reference in New Issue