We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 03f1559 commit 8fa2157Copy full SHA for 8fa2157
1 file changed
src/ui/callback.rs
@@ -2,7 +2,6 @@ use std::{
2
cell::RefCell,
3
future::poll_fn,
4
hint::unreachable_unchecked,
5
- rc::Rc,
6
task::{Poll, Waker},
7
};
8
@@ -13,8 +12,8 @@ enum WakerState<T> {
13
12
Signaled(T),
14
}
15
16
-#[derive(Debug, Clone)]
17
-pub struct Callback<T = ()>(Rc<RefCell<WakerState<T>>>);
+#[derive(Debug)]
+pub struct Callback<T = ()>(RefCell<WakerState<T>>);
18
19
impl<T> Default for Callback<T> {
20
fn default() -> Self {
@@ -24,7 +23,7 @@ impl<T> Default for Callback<T> {
24
23
25
impl<T> Callback<T> {
26
pub fn new() -> Self {
27
- Self(Rc::new(RefCell::new(WakerState::Inactive)))
+ Self(RefCell::new(WakerState::Inactive))
28
29
30
pub fn signal(&self, v: T) -> bool {
0 commit comments