Skip to content

Commit 961c440

Browse files
author
Lucas Paixão
committed
Clippy fix
1 parent 8adca13 commit 961c440

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/buf/fixed/pool.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -226,11 +226,9 @@ impl<T: IoBufMut> FixedBufPool<T> {
226226
/// An application should not rely on any particular order
227227
/// in which available buffers are retrieved.
228228
pub fn try_next(&mut self, cap: usize) -> Option<FixedBuf> {
229-
let inner = Rc::get_mut(&mut self.inner);
230-
231-
if inner.is_none() { return None }
232-
233-
inner.unwrap().try_next(cap).map(|data| {
229+
let mut inner = Rc::get_mut(&mut self.inner);
230+
231+
inner.as_mut()?.try_next(cap).map(|data| {
234232
let pool = Rc::clone(&self.inner);
235233
// Safety: the validity of buffer data is ensured by
236234
// plumbing::Pool::try_next

0 commit comments

Comments
 (0)