From 5b4b885fd6079b6e909212217d319515bc445cc1 Mon Sep 17 00:00:00 2001 From: Kornel Date: Tue, 17 Apr 2018 23:20:47 +0100 Subject: [PATCH] Replace use of try!() with ? --- src/header/common/content_range.rs | 12 ++++++------ src/header/shared/quality_item.rs | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/header/common/content_range.rs b/src/header/common/content_range.rs index ea0e3274..999307e2 100644 --- a/src/header/common/content_range.rs +++ b/src/header/common/content_range.rs @@ -171,16 +171,16 @@ impl Display for ContentRangeSpec { range, instance_length, } => { - try!(f.write_str("bytes ")); + f.write_str("bytes ")?; match range { Some((first_byte, last_byte)) => { - try!(write!(f, "{}-{}", first_byte, last_byte)); + write!(f, "{}-{}", first_byte, last_byte)?; } None => { - try!(f.write_str("*")); + f.write_str("*")?; } }; - try!(f.write_str("/")); + f.write_str("/")?; if let Some(v) = instance_length { write!(f, "{}", v) } else { @@ -191,8 +191,8 @@ impl Display for ContentRangeSpec { ref unit, ref resp, } => { - try!(f.write_str(unit)); - try!(f.write_str(" ")); + f.write_str(unit)?; + f.write_str(" ")?; f.write_str(resp) } } diff --git a/src/header/shared/quality_item.rs b/src/header/shared/quality_item.rs index 6dca77fe..5f1e5977 100644 --- a/src/header/shared/quality_item.rs +++ b/src/header/shared/quality_item.rs @@ -59,7 +59,7 @@ impl cmp::PartialOrd for QualityItem { impl fmt::Display for QualityItem { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - try!(fmt::Display::fmt(&self.item, f)); + fmt::Display::fmt(&self.item, f)?; match self.quality.0 { 1000 => Ok(()), 0 => f.write_str("; q=0"),