Skip to content

Commit

Permalink
impl Clone trait for TypedChildrenFn
Browse files Browse the repository at this point in the history
  • Loading branch information
redforks committed Dec 15, 2024
1 parent 68fdc8d commit 36025ef
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions leptos/src/children.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,13 @@ impl<T> Debug for TypedChildrenFn<T> {
}
}

impl<T> Clone for TypedChildrenFn<T> {
// Manual implementation to avoid the `T: Clone` bound.
fn clone(&self) -> Self {
Self(self.0.clone())
}
}

impl<T> TypedChildrenFn<T> {
/// Extracts the inner `children` function.
pub fn into_inner(self) -> Arc<dyn Fn() -> View<T> + Send + Sync> {
Expand Down

0 comments on commit 36025ef

Please sign in to comment.