We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8adca13 commit 961c440Copy full SHA for 961c440
src/buf/fixed/pool.rs
@@ -226,11 +226,9 @@ impl<T: IoBufMut> FixedBufPool<T> {
226
/// An application should not rely on any particular order
227
/// in which available buffers are retrieved.
228
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| {
+ let mut inner = Rc::get_mut(&mut self.inner);
+
+ inner.as_mut()?.try_next(cap).map(|data| {
234
let pool = Rc::clone(&self.inner);
235
// Safety: the validity of buffer data is ensured by
236
// plumbing::Pool::try_next
0 commit comments