Skip to content

Commit

Permalink
Add impl From<View> for Children
Browse files Browse the repository at this point in the history
  • Loading branch information
lukechu10 committed Sep 20, 2022
1 parent d9c3fc6 commit 2210e94
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/sycamore-core/src/component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,14 @@ where
}
}

impl<'a, G: GenericNode> From<View<G>> for Children<'a, G> {
fn from(view: View<G>) -> Self {
Self {
f: Box::new(|_| view),
}
}
}

impl<'a, G: GenericNode> Default for Children<'a, G> {
fn default() -> Self {
Self {
Expand Down

1 comment on commit 2210e94

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.30.

Benchmark suite Current: 2210e94 Previous: d9c3fc6 Ratio
reactivity_effects 271725 ns/iter (± 6510) 208851 ns/iter (± 732) 1.30

This comment was automatically generated by workflow using github-action-benchmark.

CC: @lukechu10

Please sign in to comment.