From bfb375749bcf2e10dfa301bf436113effa6a3321 Mon Sep 17 00:00:00 2001 From: Donghyun Kim Date: Fri, 13 Sep 2024 02:44:29 +0900 Subject: [PATCH] Organize code --- rust_crate/src/channel.rs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/rust_crate/src/channel.rs b/rust_crate/src/channel.rs index eeef4c69..995a2447 100644 --- a/rust_crate/src/channel.rs +++ b/rust_crate/src/channel.rs @@ -97,15 +97,12 @@ pub fn message_channel() -> (MessageSender, MessageReceiver) { active_receiver_id: 0, // Start with receiver ID 0 })); - let receiver = MessageReceiver { + let sender = MessageSender { inner: channel.clone(), + }; + let receiver = MessageReceiver { + inner: channel, id: 0, }; - - ( - MessageSender { - inner: channel.clone(), - }, - receiver, - ) + (sender, receiver) }