We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 67bfd5f commit 4723fffCopy full SHA for 4723fff
packages/yew/src/html/listener/mod.rs
@@ -128,3 +128,23 @@ where
128
Some(Callback::from(self?))
129
}
130
131
+
132
+#[cfg(test)]
133
+mod tests {
134
+ use super::*;
135
136
+ #[test]
137
+ fn supported_into_event_callback_types() {
138
+ let f = |_: usize| ();
139
+ let cb = Callback::from(f);
140
141
+ // Callbacks
142
+ let _: Option<Callback<usize>> = cb.clone().into_event_callback();
143
+ let _: Option<Callback<usize>> = (&cb).into_event_callback();
144
+ let _: Option<Callback<usize>> = Some(cb).into_event_callback();
145
146
+ // Fns
147
+ let _: Option<Callback<usize>> = f.into_event_callback();
148
+ let _: Option<Callback<usize>> = Some(f).into_event_callback();
149
+ }
150
+}
0 commit comments