Last unwraps (#1160)

* Work through most of the last unwraps

* Finish removing unwraps
This commit is contained in:
Jonathan Turner
2020-01-04 19:44:17 +13:00
committed by GitHub
parent 6dceabf389
commit 77d856fd53
20 changed files with 188 additions and 86 deletions

View File

@@ -64,7 +64,11 @@ impl From<BigDecimal> for Primitive {
impl From<f64> for Primitive {
fn from(float: f64) -> Primitive {
Primitive::Decimal(BigDecimal::from_f64(float).unwrap())
if let Some(f) = BigDecimal::from_f64(float) {
Primitive::Decimal(f)
} else {
unreachable!("Internal error: protocol did not use f64-compatible decimal")
}
}
}