Some simple Option / Result / iterator pattern simplifications (#3205)

This commit is contained in:
François Garillot
2020-01-29 09:20:57 -05:00
committed by GitHub
parent 616dad43fd
commit dcdbdd4bcc
10 changed files with 39 additions and 57 deletions
+1 -4
View File
@@ -105,10 +105,7 @@ impl QueryParams {
}
pub fn get(&self, name: &str) -> Option<&String> {
match self.params.get(name) {
None => None,
Some(v) => v.first(),
}
self.params.get(name).and_then(|v| v.first())
}
}