Use try syntax for Option where appropriate

This commit is contained in:
Matt Brubeck 2017-10-20 08:25:35 -07:00
parent fe16c1d5c3
commit 2d45e9d2da
19 changed files with 65 additions and 180 deletions

View file

@ -384,10 +384,7 @@ impl LineBreaker {
-> Option<Fragment>
where I: Iterator<Item=Fragment>,
{
let mut result = match self.next_fragment(old_fragment_iter) {
None => return None,
Some(fragment) => fragment,
};
let mut result = self.next_fragment(old_fragment_iter)?;
loop {
let candidate = match self.next_fragment(old_fragment_iter) {