fix: uses EXISTS to mark things that don't exist in the DOM

This commit is contained in:
Greg Johnston
2025-06-29 17:10:05 -04:00
parent c87ef331b0
commit f3557970a7
4 changed files with 5 additions and 2 deletions

View File

@@ -90,6 +90,7 @@ impl<T: RenderHtml> RenderHtml for View<T> {
type Owned = View<T::Owned>;
const MIN_LENGTH: usize = <T as RenderHtml>::MIN_LENGTH;
const EXISTS: bool = <T as RenderHtml>::EXISTS;
async fn resolve(self) -> Self::AsyncOutput {
self.inner.resolve().await

View File

@@ -413,6 +413,7 @@ where
type Owned = RegisteredMetaTag<E, At::CloneableOwned, Ch::Owned>;
const MIN_LENGTH: usize = 0;
const EXISTS: bool = false;
fn dry_resolve(&mut self) {
self.el.dry_resolve()

View File

@@ -322,6 +322,7 @@ impl RenderHtml for TitleView {
type Owned = Self;
const MIN_LENGTH: usize = 0;
const EXISTS: bool = false;
fn dry_resolve(&mut self) {}

View File

@@ -134,6 +134,7 @@ where
type Owned = (A::Owned,);
const MIN_LENGTH: usize = A::MIN_LENGTH;
const EXISTS: bool = A::EXISTS;
fn html_len(&self) -> usize {
self.0.html_len()
@@ -239,7 +240,6 @@ macro_rules! impl_view_for_tuples {
{
type State = ($first::State, $($ty::State,)*);
fn build(self) -> Self::State {
#[allow(non_snake_case)]
let ($first, $($ty,)*) = self;
@@ -267,7 +267,7 @@ macro_rules! impl_view_for_tuples {
{
type AsyncOutput = ($first::AsyncOutput, $($ty::AsyncOutput,)*);
type Owned = ($first::Owned, $($ty::Owned,)*);
const EXISTS: bool = $first::EXISTS || $($ty::EXISTS || )* false;
const MIN_LENGTH: usize = $first::MIN_LENGTH $(+ $ty::MIN_LENGTH)*;
#[inline(always)]