From 5f079b86f4acddd4ca469e326b7a4d4836f7b2ee Mon Sep 17 00:00:00 2001 From: Salem Yaslem Date: Sat, 21 Oct 2023 23:31:52 +0300 Subject: [PATCH] fix borrow_mut --- src/wayland_record.rs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/wayland_record.rs b/src/wayland_record.rs index a829d64..b7c3ea5 100644 --- a/src/wayland_record.rs +++ b/src/wayland_record.rs @@ -78,20 +78,17 @@ impl WaylandRecorder { self.filename = filename.clone(); - let mut first_empty_signal_called = false; - while let Some(msg) = message_stream.try_next().await.expect("failed to get message") { match msg.message_type() { MessageType::Signal => { - let (_, response) = msg.body::<(u32, HashMap<&str, Value>)>().expect("failed to get body"); + let (response_num, response) = msg.body::<(u32, HashMap<&str, Value>)>().expect("failed to get body"); + if response_num > 0 { + return false; + } + if response.len() == 0 { - if first_empty_signal_called { - return false; - } else { - first_empty_signal_called = true; - continue; - } + continue; } if response.contains_key("session_handle") {