Skip to content
This repository has been archived by the owner on Sep 13, 2018. It is now read-only.

Commit

Permalink
Avoid unnecessary unwrap. (#174)
Browse files Browse the repository at this point in the history
  • Loading branch information
frewsxcv authored and carllerche committed Aug 22, 2017
1 parent d20495f commit 8fb8e48
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/streaming/multiplex/frame_buf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,14 +186,7 @@ impl<T> Inner<T> {
return Some(slot);
}

let grow = {
if self.blocks.is_empty() {
true
} else {
let block = self.blocks.last().unwrap();
block.len() == block.capacity()
}
};
let grow = self.blocks.last().map_or(true, |b| b.len() == b.capacity());

if grow && !self.grow() {
return None;
Expand Down

0 comments on commit 8fb8e48

Please sign in to comment.