Skip to content

Commit

Permalink
Fix MSRV.
Browse files Browse the repository at this point in the history
  • Loading branch information
futursolo committed May 22, 2022
1 parent fca682d commit 9f82906
Show file tree
Hide file tree
Showing 17 changed files with 24 additions and 24 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ jobs:
matrix:
toolchain:
# anyway to dynamically grep the MSRV from Cargo.toml?
- 1.56.0 # MSRV
- 1.60.0 # MSRV
- stable

steps:
Expand Down Expand Up @@ -175,7 +175,7 @@ jobs:
matrix:
toolchain:
# anyway to dynamically grep the MSRV from Cargo.toml?
- 1.56.0 # MSRV
- 1.60.0 # MSRV
- stable
- nightly

Expand Down
2 changes: 1 addition & 1 deletion examples/simple_ssr/src/bin/simple_ssr_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ async fn render(

Box::new(
stream::once(async move { index_html_before })
.chain(renderer.render_streamed().await)
.chain(renderer.render_stream().await)
.chain(stream::once(async move { index_html_after }))
.map(|m| Result::<_, BoxedError>::Ok(m.into())),
)
Expand Down
2 changes: 1 addition & 1 deletion examples/ssr_router/src/bin/ssr_router_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ async fn render(

StreamBody::new(
stream::once(async move { index_html_before })
.chain(renderer.render_streamed().await)
.chain(renderer.render_stream().await)
.chain(stream::once(async move { index_html_after }))
.map(Result::<_, Infallible>::Ok),
)
Expand Down
2 changes: 1 addition & 1 deletion packages/yew-macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ license = "MIT OR Apache-2.0"
keywords = ["web", "wasm", "frontend", "webasm", "webassembly"]
categories = ["gui", "web-programming", "wasm"]
description = "A framework for making client-side single-page apps"
rust-version = "1.56.0"
rust-version = "1.60.0"

[lib]
proc-macro = true
Expand Down
2 changes: 1 addition & 1 deletion packages/yew-macro/Makefile.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tasks.test]
clear = true
toolchain = "1.56.0"
toolchain = "1.60.0"
command = "cargo"
# test target can be optionally specified like `cargo make test html_macro`,
args = ["test", "${@}"]
Expand Down
2 changes: 1 addition & 1 deletion packages/yew-macro/tests/classes_macro_test.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#[allow(dead_code)]
#[rustversion::attr(stable(1.56), test)]
#[rustversion::attr(stable(1.60), test)]
fn classes_macro() {
let t = trybuild::TestCases::new();
t.pass("tests/classes_macro/*-pass.rs");
Expand Down
2 changes: 1 addition & 1 deletion packages/yew-macro/tests/derive_props_test.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#[allow(dead_code)]
#[rustversion::attr(stable(1.56), test)]
#[rustversion::attr(stable(1.60), test)]
fn derive_props() {
let t = trybuild::TestCases::new();
t.pass("tests/derive_props/pass.rs");
Expand Down
2 changes: 1 addition & 1 deletion packages/yew-macro/tests/function_attr_test.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#[allow(dead_code)]
#[rustversion::attr(stable(1.56), test)]
#[rustversion::attr(stable(1.60), test)]
fn tests() {
let t = trybuild::TestCases::new();
t.pass("tests/function_component_attr/*-pass.rs");
Expand Down
2 changes: 1 addition & 1 deletion packages/yew-macro/tests/hook_attr_test.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#[allow(dead_code)]
#[rustversion::attr(stable(1.56), test)]
#[rustversion::attr(stable(1.60), test)]
fn tests() {
let t = trybuild::TestCases::new();
t.pass("tests/hook_attr/*-pass.rs");
Expand Down
2 changes: 1 addition & 1 deletion packages/yew-macro/tests/html_macro_test.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use yew::{html, html_nested};

#[allow(dead_code)]
#[rustversion::attr(stable(1.56), test)]
#[rustversion::attr(stable(1.60), test)]
fn html_macro() {
let t = trybuild::TestCases::new();

Expand Down
2 changes: 1 addition & 1 deletion packages/yew-macro/tests/props_macro_test.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#[allow(dead_code)]
#[rustversion::attr(stable(1.56), test)]
#[rustversion::attr(stable(1.60), test)]
fn props_macro() {
let t = trybuild::TestCases::new();
t.pass("tests/props_macro/*-pass.rs");
Expand Down
2 changes: 1 addition & 1 deletion packages/yew-router-macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2021"
license = "MIT OR Apache-2.0"
description = "Contains macros used with yew-router"
repository = "/~https://github.com/yewstack/yew"
rust-version = "1.56.0"
rust-version = "1.60.0"

[lib]
proc-macro = true
Expand Down
2 changes: 1 addition & 1 deletion packages/yew-router-macro/Makefile.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tasks.test]
clear = true
toolchain = "1.56.0"
toolchain = "1.60.0"
command = "cargo"
args = ["test"]

Expand Down
2 changes: 1 addition & 1 deletion packages/yew-router-macro/tests/routable_derive_test.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#[allow(dead_code)]
#[rustversion::attr(stable(1.56), test)]
#[rustversion::attr(stable(1.60), test)]
fn tests() {
let t = trybuild::TestCases::new();
t.pass("tests/routable_derive/*-pass.rs");
Expand Down
2 changes: 1 addition & 1 deletion packages/yew-router/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ keywords = ["web", "yew", "router"]
categories = ["gui", "web-programming"]
description = "A router implementation for the Yew framework"
repository = "/~https://github.com/yewstack/yew"
rust-version = "1.56.0"
rust-version = "1.60.0"

[dependencies]
yew = { version = "0.19.3", path = "../yew", default-features= false }
Expand Down
6 changes: 3 additions & 3 deletions packages/yew/src/platform.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! module that provides io compatibility over browser tasks and other asyncio runtimes (e.g.:
//! tokio)
//! This module provides io compatibility over browser tasks and other asyncio runtimes (e.g.:
//! tokio).
use std::future::Future;

Expand Down Expand Up @@ -36,7 +36,7 @@ mod arch {
use tokio_util::task::LocalPoolHandle;

static POOL_HANDLE: Lazy<LocalPoolHandle> =
Lazy::new(|| LocalPoolHandle::new(num_cpus::get()));
Lazy::new(|| LocalPoolHandle::new(num_cpus::get() * 2));

POOL_HANDLE
.spawn_pinned(create_task)
Expand Down
10 changes: 5 additions & 5 deletions packages/yew/src/server_renderer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ where

/// Renders Yew Application to a String.
pub async fn render_to_string(self, w: &mut String) {
let mut s = self.render_streamed().await;
let mut s = self.render_stream().await;

while let Some(m) = s.next().await {
w.push_str(&m);
Expand All @@ -81,7 +81,7 @@ where
/// Renders Yew Applications into a string Stream
// Whilst not required to be async here, this function is async to keep the same function
// signature as the ServerRenderer.
pub async fn render_streamed(self) -> impl Stream<Item = String> {
pub async fn render_stream(self) -> impl Stream<Item = String> {
let (mut tx, rx) = mpsc::unbounded::<String>();

let scope = Scope::<COMP>::new(None);
Expand Down Expand Up @@ -168,21 +168,21 @@ where

/// Renders Yew Application to a String.
pub async fn render_to_string(self, w: &mut String) {
let mut s = self.render_streamed().await;
let mut s = self.render_stream().await;

while let Some(m) = s.next().await {
w.push_str(&m);
}
}

/// Renders Yew Applications into a string Stream.
pub async fn render_streamed(self) -> impl Stream<Item = String> {
pub async fn render_stream(self) -> impl Stream<Item = String> {
let Self { props, hydratable } = self;

run_pinned(move || async move {
LocalServerRenderer::<COMP>::with_props(props)
.hydratable(hydratable)
.render_streamed()
.render_stream()
.await
})
.await
Expand Down

0 comments on commit 9f82906

Please sign in to comment.