diff --git a/examples/counter/rust-toolchain.toml b/examples/counter/rust-toolchain.toml index 99fa95aaa..292fe499e 100644 --- a/examples/counter/rust-toolchain.toml +++ b/examples/counter/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "nightly-2024-03-31" +channel = "stable" diff --git a/examples/counters/rust-toolchain.toml b/examples/counters/rust-toolchain.toml index 99fa95aaa..292fe499e 100644 --- a/examples/counters/rust-toolchain.toml +++ b/examples/counters/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "nightly-2024-03-31" +channel = "stable" diff --git a/examples/directives/rust-toolchain.toml b/examples/directives/rust-toolchain.toml index 99fa95aaa..292fe499e 100644 --- a/examples/directives/rust-toolchain.toml +++ b/examples/directives/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "nightly-2024-03-31" +channel = "stable" diff --git a/examples/error_boundary/rust-toolchain.toml b/examples/error_boundary/rust-toolchain.toml index 99fa95aaa..292fe499e 100644 --- a/examples/error_boundary/rust-toolchain.toml +++ b/examples/error_boundary/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "nightly-2024-03-31" +channel = "stable" diff --git a/examples/errors_axum/rust-toolchain.toml b/examples/errors_axum/rust-toolchain.toml index 99fa95aaa..292fe499e 100644 --- a/examples/errors_axum/rust-toolchain.toml +++ b/examples/errors_axum/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "nightly-2024-03-31" +channel = "stable" diff --git a/examples/fetch/rust-toolchain.toml b/examples/fetch/rust-toolchain.toml index 99fa95aaa..292fe499e 100644 --- a/examples/fetch/rust-toolchain.toml +++ b/examples/fetch/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "nightly-2024-03-31" +channel = "stable" diff --git a/examples/hackernews/rust-toolchain.toml b/examples/hackernews/rust-toolchain.toml index 99fa95aaa..292fe499e 100644 --- a/examples/hackernews/rust-toolchain.toml +++ b/examples/hackernews/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "nightly-2024-03-31" +channel = "stable" diff --git a/examples/hackernews_axum/rust-toolchain.toml b/examples/hackernews_axum/rust-toolchain.toml index 99fa95aaa..292fe499e 100644 --- a/examples/hackernews_axum/rust-toolchain.toml +++ b/examples/hackernews_axum/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "nightly-2024-03-31" +channel = "stable" diff --git a/examples/hackernews_islands_axum/rust-toolchain.toml b/examples/hackernews_islands_axum/rust-toolchain.toml index 99fa95aaa..292fe499e 100644 --- a/examples/hackernews_islands_axum/rust-toolchain.toml +++ b/examples/hackernews_islands_axum/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "nightly-2024-03-31" +channel = "stable" diff --git a/examples/hackernews_islands_axum/src/lib.rs b/examples/hackernews_islands_axum/src/lib.rs index 50aa6366e..ea9a7d8f7 100644 --- a/examples/hackernews_islands_axum/src/lib.rs +++ b/examples/hackernews_islands_axum/src/lib.rs @@ -1,5 +1,3 @@ -#![feature(lazy_cell)] - use leptos::*; use leptos_meta::*; use leptos_router::*; diff --git a/examples/portal/rust-toolchain.toml b/examples/portal/rust-toolchain.toml index 99fa95aaa..292fe499e 100644 --- a/examples/portal/rust-toolchain.toml +++ b/examples/portal/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "nightly-2024-03-31" +channel = "stable" diff --git a/examples/router/rust-toolchain.toml b/examples/router/rust-toolchain.toml index 99fa95aaa..292fe499e 100644 --- a/examples/router/rust-toolchain.toml +++ b/examples/router/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "nightly-2024-03-31" +channel = "stable" diff --git a/examples/server_fns_axum/rust-toolchain.toml b/examples/server_fns_axum/rust-toolchain.toml index 99fa95aaa..292fe499e 100644 --- a/examples/server_fns_axum/rust-toolchain.toml +++ b/examples/server_fns_axum/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "nightly-2024-03-31" +channel = "stable" diff --git a/examples/session_auth_axum/rust-toolchain.toml b/examples/session_auth_axum/rust-toolchain.toml index 99fa95aaa..292fe499e 100644 --- a/examples/session_auth_axum/rust-toolchain.toml +++ b/examples/session_auth_axum/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "nightly-2024-03-31" +channel = "stable" diff --git a/examples/slots/rust-toolchain.toml b/examples/slots/rust-toolchain.toml index 99fa95aaa..292fe499e 100644 --- a/examples/slots/rust-toolchain.toml +++ b/examples/slots/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "nightly-2024-03-31" +channel = "stable" diff --git a/examples/ssr_modes/rust-toolchain.toml b/examples/ssr_modes/rust-toolchain.toml index 99fa95aaa..292fe499e 100644 --- a/examples/ssr_modes/rust-toolchain.toml +++ b/examples/ssr_modes/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "nightly-2024-03-31" +channel = "stable" diff --git a/examples/ssr_modes/src/app.rs b/examples/ssr_modes/src/app.rs index e69357a9f..437770721 100644 --- a/examples/ssr_modes/src/app.rs +++ b/examples/ssr_modes/src/app.rs @@ -80,20 +80,24 @@ fn Post() -> impl IntoView { .map_err(|_| PostError::InvalidId) }) }; - let post = create_resource(id, |id| async move { + let post_resource = create_resource(id, |id| async move { match id { Err(e) => Err(e), Ok(id) => get_post(id) .await .map(|data| data.ok_or(PostError::PostNotFound)) - .map_err(|_| PostError::ServerError) - .flatten(), + .map_err(|_| PostError::ServerError), } }); + let post = move || match post_resource.get() { + Some(Ok(Ok(v))) => Ok(v), + _ => Err(PostError::ServerError), + }; + let post_view = move || { - post.and_then(|post| { - view! { + post().and_then(|post| { + Ok(view! { // render content

{&post.title}

{&post.content}

@@ -103,7 +107,7 @@ fn Post() -> impl IntoView { // when it's first served <Meta name="description" content=post.content.clone()/> - } + }) }) }; diff --git a/examples/ssr_modes/src/lib.rs b/examples/ssr_modes/src/lib.rs index b6f5d5ebb..6f0ba4e52 100644 --- a/examples/ssr_modes/src/lib.rs +++ b/examples/ssr_modes/src/lib.rs @@ -1,5 +1,3 @@ -#![feature(result_flattening)] - pub mod app; #[cfg(feature = "hydrate")] diff --git a/examples/ssr_modes_axum/rust-toolchain.toml b/examples/ssr_modes_axum/rust-toolchain.toml index 99fa95aaa..292fe499e 100644 --- a/examples/ssr_modes_axum/rust-toolchain.toml +++ b/examples/ssr_modes_axum/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "nightly-2024-03-31" +channel = "stable" diff --git a/examples/ssr_modes_axum/src/app.rs b/examples/ssr_modes_axum/src/app.rs index 1b042d64f..906c3677e 100644 --- a/examples/ssr_modes_axum/src/app.rs +++ b/examples/ssr_modes_axum/src/app.rs @@ -80,20 +80,24 @@ fn Post() -> impl IntoView { .map_err(|_| PostError::InvalidId) }) }; - let post = create_resource(id, |id| async move { + let post_resource = create_resource(id, |id| async move { match id { Err(e) => Err(e), Ok(id) => get_post(id) .await .map(|data| data.ok_or(PostError::PostNotFound)) - .map_err(|_| PostError::ServerError) - .flatten(), + .map_err(|_| PostError::ServerError), } }); + let post = move || match post_resource.get() { + Some(Ok(Ok(v))) => Ok(v), + _ => Err(PostError::ServerError), + }; + let post_view = move || { - post.and_then(|post| { - view! { + post().and_then(|post| { + Ok(view! { // render content <h1>{&post.title}</h1> <p>{&post.content}</p> @@ -103,7 +107,7 @@ fn Post() -> impl IntoView { // when it's first served <Title text=post.title.clone()/> <Meta name="description" content=post.content.clone()/> - } + }) }) }; diff --git a/examples/ssr_modes_axum/src/lib.rs b/examples/ssr_modes_axum/src/lib.rs index 344da184e..3bed2f1a1 100644 --- a/examples/ssr_modes_axum/src/lib.rs +++ b/examples/ssr_modes_axum/src/lib.rs @@ -1,5 +1,3 @@ -#![feature(result_flattening)] - pub mod app; #[cfg(feature = "ssr")] diff --git a/examples/tailwind_actix/rust-toolchain.toml b/examples/tailwind_actix/rust-toolchain.toml index 99fa95aaa..292fe499e 100644 --- a/examples/tailwind_actix/rust-toolchain.toml +++ b/examples/tailwind_actix/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "nightly-2024-03-31" +channel = "stable" diff --git a/examples/tailwind_axum/rust-toolchain.toml b/examples/tailwind_axum/rust-toolchain.toml index 99fa95aaa..292fe499e 100644 --- a/examples/tailwind_axum/rust-toolchain.toml +++ b/examples/tailwind_axum/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "nightly-2024-03-31" +channel = "stable" diff --git a/examples/tailwind_csr/rust-toolchain.toml b/examples/tailwind_csr/rust-toolchain.toml index 99fa95aaa..292fe499e 100644 --- a/examples/tailwind_csr/rust-toolchain.toml +++ b/examples/tailwind_csr/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "nightly-2024-03-31" +channel = "stable" diff --git a/examples/timer/rust-toolchain.toml b/examples/timer/rust-toolchain.toml index 99fa95aaa..292fe499e 100644 --- a/examples/timer/rust-toolchain.toml +++ b/examples/timer/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "nightly-2024-03-31" +channel = "stable" diff --git a/examples/todo_app_sqlite/rust-toolchain.toml b/examples/todo_app_sqlite/rust-toolchain.toml index 99fa95aaa..292fe499e 100644 --- a/examples/todo_app_sqlite/rust-toolchain.toml +++ b/examples/todo_app_sqlite/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "nightly-2024-03-31" +channel = "stable"