summaryrefslogtreecommitdiffstats
path: root/src/parser/iterator.rs
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2020-03-05 19:51:13 +0100
committerMatthias Beyer <mail@beyermatthias.de>2020-03-05 19:51:13 +0100
commit2a75e24c9834b2f4599e0b310454a72e0b59debb (patch)
tree1f9098e96e80292a5b8bba0ef856906141f3b482 /src/parser/iterator.rs
parent07f108e1d25da387735ce2ddca04a768a2739d9f (diff)
Replace try!() with ? operator
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'src/parser/iterator.rs')
-rw-r--r--src/parser/iterator.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/parser/iterator.rs b/src/parser/iterator.rs
index 8661646..be814b0 100644
--- a/src/parser/iterator.rs
+++ b/src/parser/iterator.rs
@@ -91,7 +91,7 @@ impl Iterator {
Iterspec::Yearly => unit_to_amount(1, Unit::Year),
};
- let into_ndt = |e: timetype::TimeType| try!(e.calculate())
+ let into_ndt = |e: timetype::TimeType| e.calculate()?
.get_moment()
.ok_or(Error::NotADateInsideIterator)
.map_err(Error::from)
@@ -99,22 +99,22 @@ impl Iterator {
match self.2 {
Some(UntilSpec::Exact(e)) => {
- let base = try!(into_ndt(self.0.into_timetype()?));
- let e = try!(into_ndt(e.into_timetype()?));
+ let base = into_ndt(self.0.into_timetype()?)?;
+ let e = into_ndt(e.into_timetype()?)?;
iter::Iter::build(base, recur)
.map(|it| UserIterator::UntilIterator(it.until(e)))
},
Some(UntilSpec::Times(i)) => {
- let base = try!(into_ndt(self.0.into_timetype()?));
+ let base = into_ndt(self.0.into_timetype()?)?;
iter::Iter::build(base, recur)
.map(|it| it.times(i))
.map(UserIterator::TimesIter)
},
None => {
- let base = try!(into_ndt(self.0.into_timetype()?));
+ let base = into_ndt(self.0.into_timetype()?)?;
iter::Iter::build(base, recur)
.map(UserIterator::Iterator)
},