We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 9ad579f + 021a11f commit 3543b7eCopy full SHA for 3543b7e
exercises/decimal/Cargo-example.toml
@@ -4,6 +4,5 @@ name = "decimal"
4
version = "0.1.0"
5
6
[dependencies]
7
-try_opt = "0.1.1"
8
num-bigint = "0.1.40"
9
num-traits = "0.1.40"
exercises/decimal/example.rs
@@ -2,9 +2,6 @@ use std::cmp::Ordering;
2
use std::fmt;
3
use std::ops::{Add, Mul, Sub};
-#[macro_use]
-extern crate try_opt;
-
extern crate num_bigint;
use num_bigint::BigInt;
10
extern crate num_traits;
@@ -55,11 +52,8 @@ impl Decimal {
55
52
}
56
53
57
54
Some(Decimal::new(
58
- try_opt!(digits.parse::<BigInt>().ok()),
59
- match decimal_index {
60
- Some(idx) => idx,
61
- None => 0,
62
- },
+ digits.parse().ok()?,
+ decimal_index.unwrap_or_default(),
63
))
64
65
0 commit comments