Skip to content

Commit b5d2cc5

Browse files
committed
feat(react): impl Clone and Debug for WrapFn
1 parent 44a5cce commit b5d2cc5

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

crates/react/src/safe_into_js/closure.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,18 @@ impl<F: ?Sized> WrapFn<F, ()> {
2626
}
2727
}
2828

29+
impl<F: ?Sized, TArgs> Clone for WrapFn<F, TArgs> {
30+
fn clone(&self) -> Self {
31+
Self(self.0.clone(), PhantomData)
32+
}
33+
}
34+
35+
impl<F: ?Sized, TArgs> std::fmt::Debug for WrapFn<F, TArgs> {
36+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
37+
write!(f, "WrapFn<{}>", std::any::type_name::<F>())
38+
}
39+
}
40+
2941
impl<F> WrapFnMut<F, ()> {
3042
#[inline]
3143
pub fn new<A>(func: F) -> WrapFnMut<F, A>

0 commit comments

Comments
 (0)