From 94afa5a8b7fee89b94ff24fee9835ad2331e68b4 Mon Sep 17 00:00:00 2001 From: Donghyun Kim Date: Sun, 15 Sep 2024 01:15:04 +0900 Subject: [PATCH] Organize code --- rust_crate/src/shutdown.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/rust_crate/src/shutdown.rs b/rust_crate/src/shutdown.rs index 71a4cbd6..81a76ec9 100644 --- a/rust_crate/src/shutdown.rs +++ b/rust_crate/src/shutdown.rs @@ -79,12 +79,12 @@ impl Event { /// Creates a future that will be resolved when the flag is set to `true`. pub fn wait_async(&self) -> EventFuture { - let inner = match self.inner.lock() { + let guard = match self.inner.lock() { Ok(inner) => inner, Err(poisoned) => poisoned.into_inner(), }; EventFuture { - started_session: inner.session, + started_session: guard.session, inner: self.inner.clone(), } } @@ -120,11 +120,10 @@ impl EventBlocking { Ok(inner) => inner, Err(poisoned) => poisoned.into_inner(), }; - let start_session = guard.session; EventBlocking { inner: inner.clone(), condvar, - started_session: start_session, + started_session: guard.session, } }