From af57ef6cc854159c0e185adf19cf3d5ecc92dad2 Mon Sep 17 00:00:00 2001 From: kjuulh Date: Sat, 25 May 2024 13:58:13 +0200 Subject: [PATCH] feat: use arc instead Signed-off-by: kjuulh --- crates/cuddle-clusters/src/components.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/cuddle-clusters/src/components.rs b/crates/cuddle-clusters/src/components.rs index 5cc5c65..1516aea 100644 --- a/crates/cuddle-clusters/src/components.rs +++ b/crates/cuddle-clusters/src/components.rs @@ -1,4 +1,4 @@ -use std::rc::Rc; +use std::sync::Arc; pub trait Component { fn name(&self) -> String; @@ -27,11 +27,11 @@ pub trait Component { #[derive(Clone)] pub struct ConcreteComponent { - inner: Rc, + inner: Arc, } impl std::ops::Deref for ConcreteComponent { - type Target = Rc; + type Target = Arc; fn deref(&self) -> &Self::Target { &self.inner @@ -40,7 +40,7 @@ impl std::ops::Deref for ConcreteComponent { impl ConcreteComponent { pub fn new(t: T) -> Self { - Self { inner: Rc::new(t) } + Self { inner: Arc::new(t) } } }