diff --git a/src/fs/mem.rs b/src/fs/mem.rs index 0abf58e951..b38621b14b 100644 --- a/src/fs/mem.rs +++ b/src/fs/mem.rs @@ -52,8 +52,7 @@ impl ObjectInterface for RomFileInterface { async fn poll(&self, event: PollEvent) -> Result { let mut result: PollEvent = PollEvent::empty(); let len = self.inner.read().await.data.len(); - let pos_guard = self.pos.lock().await; - let pos = *pos_guard; + let pos = *self.pos.lock().await; if event.contains(PollEvent::POLLIN) && pos < len { result.insert(PollEvent::POLLIN); @@ -138,8 +137,7 @@ impl ObjectInterface for RamFileInterface { async fn poll(&self, event: PollEvent) -> Result { let mut result: PollEvent = PollEvent::empty(); let len = self.inner.read().await.data.len(); - let pos_guard = self.pos.lock().await; - let pos = *pos_guard; + let pos = *self.pos.lock().await; if event.contains(PollEvent::POLLIN) && pos < len { result.insert(PollEvent::POLLIN);