style(all): Address suggestions made by rust-clippy

This commit is contained in:
Corey Farwell
2015-12-22 23:26:16 -08:00
parent 7d4db58c8c
commit 4c7f6f0c1e
14 changed files with 39 additions and 38 deletions

View File

@@ -109,9 +109,10 @@ impl EntityTag {
impl Display for EntityTag {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self.weak {
true => write!(f, "W/\"{}\"", self.tag),
false => write!(f, "\"{}\"", self.tag),
if self.weak {
write!(f, "W/\"{}\"", self.tag)
} else {
write!(f, "\"{}\"", self.tag)
}
}
}

View File

@@ -101,7 +101,7 @@ impl<T: str::FromStr> str::FromStr for QualityItem<T> {
match raw_item.parse::<T>() {
// we already checked above that the quality is within range
Ok(item) => Ok(QualityItem::new(item, from_f32(quality))),
Err(_) => return Err(::Error::Header),
Err(_) => Err(::Error::Header),
}
}
}