Cleanup more of core

This commit is contained in:
Jonathan Kelley committed 2024-01-16 17:14:19 -08:00
1 parent 9f595171ce
commit 374c7d0cd8
10 files changed
+192 -237

No files matched your search

+18 -19
View File
@@ -11,27 +11,26 @@ pub(crate) trait AnyProps {
fn duplicate(&self) -> BoxedAnyProps;
}
pub(crate) struct VProps<P: 'static> {
pub render_fn: Component<P>,
pub memo: fn(&P, &P) -> bool,
pub props: P,
pub name: &'static str,
/// Create a new boxed props object.
pub fn new_any_props<P: 'static + Clone>(
render_fn: Component<P>,
memo: fn(&P, &P) -> bool,
props: P,
name: &'static str,
) -> Box<dyn AnyProps> {
Box::new(VProps {
render_fn,
memo,
props,
name,
})
}
impl<P: 'static> VProps<P> {
pub(crate) fn new(
render_fn: Component<P>,
memo: fn(&P, &P) -> bool,
props: P,
name: &'static str,
) -> Self {
Self {
render_fn,
memo,
props,
name,
}
}
struct VProps<P> {
render_fn: Component<P>,
memo: fn(&P, &P) -> bool,
props: P,
name: &'static str,
}
impl<P: Clone + 'static> AnyProps for VProps<P> {