Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
parent
10a56ad690
commit
af57ef6cc8
@ -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<dyn Component + 'static>,
|
||||
inner: Arc<dyn Component + 'static>,
|
||||
}
|
||||
|
||||
impl std::ops::Deref for ConcreteComponent {
|
||||
type Target = Rc<dyn Component + 'static>;
|
||||
type Target = Arc<dyn Component + 'static>;
|
||||
|
||||
fn deref(&self) -> &Self::Target {
|
||||
&self.inner
|
||||
@ -40,7 +40,7 @@ impl std::ops::Deref for ConcreteComponent {
|
||||
|
||||
impl ConcreteComponent {
|
||||
pub fn new<T: Component + 'static>(t: T) -> Self {
|
||||
Self { inner: Rc::new(t) }
|
||||
Self { inner: Arc::new(t) }
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user