From a52e91767eb2cbbac96e3e6d9f14d5034ef14912 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Tue, 21 Dec 2021 11:17:34 +0100 Subject: Wrap Profile in RwLock We need mutable access to the profile if we want to write to it, so this commit changes the Profile to wrapped in a tokio::sync::RwLock Signed-off-by: Matthias Beyer --- gui/src/gossip.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gui/src/gossip.rs') diff --git a/gui/src/gossip.rs b/gui/src/gossip.rs index ac6bab0..c88c29c 100644 --- a/gui/src/gossip.rs +++ b/gui/src/gossip.rs @@ -1,6 +1,7 @@ use std::sync::Arc; use futures::StreamExt; +use tokio::sync::RwLock; use distrox_lib::profile::Profile; use distrox_lib::client::Client; @@ -9,12 +10,12 @@ use crate::app::Message; #[derive(Clone, Debug)] pub struct GossipRecipe { - profile: Arc, + profile: Arc>, subscription: Arc, } impl GossipRecipe { - pub fn new(profile: Arc, subscription: ipfs::SubscriptionStream) -> Self { + pub fn new(profile: Arc>, subscription: ipfs::SubscriptionStream) -> Self { Self { profile, subscription: Arc::new(subscription) } } } -- cgit v1.2.3