Skip to content

Commit 8fa2157

Browse files
committed
fix: remove Rc inside Callback
1 parent 03f1559 commit 8fa2157

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

src/ui/callback.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ use std::{
22
cell::RefCell,
33
future::poll_fn,
44
hint::unreachable_unchecked,
5-
rc::Rc,
65
task::{Poll, Waker},
76
};
87

@@ -13,8 +12,8 @@ enum WakerState<T> {
1312
Signaled(T),
1413
}
1514

16-
#[derive(Debug, Clone)]
17-
pub struct Callback<T = ()>(Rc<RefCell<WakerState<T>>>);
15+
#[derive(Debug)]
16+
pub struct Callback<T = ()>(RefCell<WakerState<T>>);
1817

1918
impl<T> Default for Callback<T> {
2019
fn default() -> Self {
@@ -24,7 +23,7 @@ impl<T> Default for Callback<T> {
2423

2524
impl<T> Callback<T> {
2625
pub fn new() -> Self {
27-
Self(Rc::new(RefCell::new(WakerState::Inactive)))
26+
Self(RefCell::new(WakerState::Inactive))
2827
}
2928

3029
pub fn signal(&self, v: T) -> bool {

0 commit comments

Comments
 (0)