From 2968aecc854e817102b3e0e1c25998af791fc453 Mon Sep 17 00:00:00 2001 From: Kaede Hoshikawa Date: Wed, 20 Jul 2022 01:19:59 +0900 Subject: [PATCH] Always inline sleep. --- packages/yew/src/platform/rt_tokio/time.rs | 2 +- packages/yew/src/platform/rt_wasm_bindgen/time.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/yew/src/platform/rt_tokio/time.rs b/packages/yew/src/platform/rt_tokio/time.rs index c6d49abdbe2..bcab607c3ef 100644 --- a/packages/yew/src/platform/rt_tokio/time.rs +++ b/packages/yew/src/platform/rt_tokio/time.rs @@ -4,7 +4,7 @@ use std::time::Duration; use futures::stream::{Stream, StreamExt}; use tokio_stream::wrappers::IntervalStream; -#[inline] +#[inline(always)] pub(crate) fn sleep(dur: Duration) -> impl Future { tokio::time::sleep(dur) } diff --git a/packages/yew/src/platform/rt_wasm_bindgen/time.rs b/packages/yew/src/platform/rt_wasm_bindgen/time.rs index 2e4e7da9636..0cdc158a77e 100644 --- a/packages/yew/src/platform/rt_wasm_bindgen/time.rs +++ b/packages/yew/src/platform/rt_wasm_bindgen/time.rs @@ -4,7 +4,7 @@ use std::time::Duration; use futures::stream::Stream; use wasm_bindgen::UnwrapThrowExt; -#[inline] +#[inline(always)] pub(crate) fn sleep(dur: Duration) -> impl Future { gloo::timers::future::sleep(dur) }