I am not able to wrap my head around the error message! It looks to me that "expected struct" and "found struct" in the message below are the same!! I am on nightly
.
error[E0308]: `match` arms have incompatible types
--> leptos/src/components/home.rs:16:18
|
12 | {move || match is_logged_in.get() {
| ------------------------ `match` arms have incompatible types
13 | true => view! {
| _____________________-
14 | | <Login />
15 | | }.into_view(),
| |_________________________- this is found to be of type `leptos::prelude::View<leptos::prelude::View<impl leptos::IntoView>>`
16 | _ => view! {
| __________________^
17 | | <AlreadyLoggedIn />
18 | | }.into_view(),
| |_________________________^ expected opaque type, found a different opaque type
|
::: leptos/src/components/login.rs:9:19
|
9 | pub fn Login() -> impl IntoView {
| ------------- the expected opaque type
...
28 | pub fn AlreadyLoggedIn() -> impl IntoView {
| ------------- the found opaque type
|
= note: expected struct `leptos::prelude::View<leptos::prelude::View<impl leptos::IntoView>>`
found struct `leptos::prelude::View<leptos::prelude::View<impl leptos::IntoView>>`
= note: distinct uses of `impl Trait` result in different opaque types
For more information about this error, try `rustc --explain E0308`.
error: could not compile `frontend-leptos` (bin "frontend-leptos") due to 1 previous error
I am playing with leptos crate. The code that emit this error is rust-projects/leptos at 31d0feeef8993f006cc6d7c583c395d3639ceea8 · dilawar/rust-projects · GitHub