Replace uses of try!() macro with "?" operator

This commit is contained in:
Matthias Beyer 2017-10-30 20:19:29 +01:00
parent 1dda98e17e
commit 9308c05057
5 changed files with 15 additions and 15 deletions

View file

@ -88,13 +88,13 @@ pub fn day(rt: &Runtime) -> i32 {
acc.and_then(|_| { acc.and_then(|_| {
debug!("Processing {:?}", e.get_location()); debug!("Processing {:?}", e.get_location());
let tag = try!(e.get_timetrack_tag()); let tag = e.get_timetrack_tag()?;
debug!(" -> tag = {:?}", tag); debug!(" -> tag = {:?}", tag);
let start = try!(e.get_start_datetime()); let start = e.get_start_datetime()?;
debug!(" -> start = {:?}", start); debug!(" -> start = {:?}", start);
let end = try!(e.get_end_datetime()); let end = e.get_end_datetime()?;
debug!(" -> end = {:?}", end); debug!(" -> end = {:?}", end);
match (start, end) { match (start, end) {

View file

@ -91,13 +91,13 @@ pub fn list(rt: &Runtime) -> i32 {
acc.and_then(|_| { acc.and_then(|_| {
debug!("Processing {:?}", e.get_location()); debug!("Processing {:?}", e.get_location());
let tag = try!(e.get_timetrack_tag()); let tag = e.get_timetrack_tag()?;
debug!(" -> tag = {:?}", tag); debug!(" -> tag = {:?}", tag);
let start = try!(e.get_start_datetime()); let start = e.get_start_datetime()?;
debug!(" -> start = {:?}", start); debug!(" -> start = {:?}", start);
let end = try!(e.get_end_datetime()); let end = e.get_end_datetime()?;
debug!(" -> end = {:?}", end); debug!(" -> end = {:?}", end);
match (start, end) { match (start, end) {

View file

@ -103,13 +103,13 @@ pub fn month(rt: &Runtime) -> i32 {
acc.and_then(|_| { acc.and_then(|_| {
debug!("Processing {:?}", e.get_location()); debug!("Processing {:?}", e.get_location());
let tag = try!(e.get_timetrack_tag()); let tag = e.get_timetrack_tag()?;
debug!(" -> tag = {:?}", tag); debug!(" -> tag = {:?}", tag);
let start = try!(e.get_start_datetime()); let start = e.get_start_datetime()?;
debug!(" -> start = {:?}", start); debug!(" -> start = {:?}", start);
let end = try!(e.get_end_datetime()); let end = e.get_end_datetime()?;
debug!(" -> end = {:?}", end); debug!(" -> end = {:?}", end);
match (start, end) { match (start, end) {

View file

@ -95,13 +95,13 @@ pub fn week(rt: &Runtime) -> i32 {
acc.and_then(|_| { acc.and_then(|_| {
debug!("Processing {:?}", e.get_location()); debug!("Processing {:?}", e.get_location());
let tag = try!(e.get_timetrack_tag()); let tag = e.get_timetrack_tag()?;
debug!(" -> tag = {:?}", tag); debug!(" -> tag = {:?}", tag);
let start = try!(e.get_start_datetime()); let start = e.get_start_datetime()?;
debug!(" -> start = {:?}", start); debug!(" -> start = {:?}", start);
let end = try!(e.get_end_datetime()); let end = e.get_end_datetime()?;
debug!(" -> end = {:?}", end); debug!(" -> end = {:?}", end);
match (start, end) { match (start, end) {

View file

@ -94,13 +94,13 @@ pub fn year(rt: &Runtime) -> i32 {
acc.and_then(|_| { acc.and_then(|_| {
debug!("Processing {:?}", e.get_location()); debug!("Processing {:?}", e.get_location());
let tag = try!(e.get_timetrack_tag()); let tag = e.get_timetrack_tag()?;
debug!(" -> tag = {:?}", tag); debug!(" -> tag = {:?}", tag);
let start = try!(e.get_start_datetime()); let start = e.get_start_datetime()?;
debug!(" -> start = {:?}", start); debug!(" -> start = {:?}", start);
let end = try!(e.get_end_datetime()); let end = e.get_end_datetime()?;
debug!(" -> end = {:?}", end); debug!(" -> end = {:?}", end);
match (start, end) { match (start, end) {