bram209 / leptosfmt

A formatter for the leptos view! macro
Apache License 2.0
271 stars 29 forks source link

Generic type parameters disappear #124

Closed tversteeg closed 4 months ago

tversteeg commented 5 months ago

When I copy this example:

#[component]
fn SizeOf<T: Sized>(#[prop(optional)] _ty: PhantomData<T>) -> impl IntoView {
    std::mem::size_of::<T>()
}

#[component]
pub fn App() -> impl IntoView {
    view! {
        <SizeOf<usize>/>
        <SizeOf<String>/>
    }
}

And format it, the <usize> and <String> type parameters disappear:

// ...

#[component]
pub fn App() -> impl IntoView {
    view! {
        <SizeOf/>
        <SizeOf/>
    }
}