Skip to content

Commit 7bc4b8d

Browse files
Rust edition 2024 / 1.85 and bump gloo to 0.12 (#16)
* Migrate to Rust edition 2024 and require Rust 1.85 - Set edition to 2024 and rust-version to 1.85 - Replace once_cell::sync::Lazy with std::sync::LazyLock - Remove redundant std::future::Future imports (now in prelude) - Remove bare_trait_objects and anonymous_parameters from deny list (hard errors in edition 2024) - Switch cfg(documenting) to cfg(docsrs) for check-cfg compatibility - Apply edition 2024 rustfmt formatting * chore: gloo from 0.11 to 0.12 * v0.3.0 * Remove unused --cfg releasing from CI
1 parent 50a11d1 commit 7bc4b8d

13 files changed

Lines changed: 23 additions & 38 deletions

File tree

.github/workflows/everything.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,7 @@ jobs:
6767
- name: Run cargo publish --dry-run
6868
if: github.ref == 'refs/heads/master'
6969
run: cargo publish --dry-run
70-
env:
71-
RUSTFLAGS: "--cfg releasing"
7270

7371
- name: Run cargo publish
7472
if: startsWith(github.ref, 'refs/tags/')
7573
run: cargo publish --token ${{ secrets.CRATES_IO_TOKEN }}
76-
env:
77-
RUSTFLAGS: "--cfg releasing"

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
### v0.3.0
4+
5+
- Migrate to Rust edition 2024 and require Rust 1.85.
6+
- Replace `once_cell` with `std::sync::LazyLock`.
7+
- Use standard `docsrs` cfg instead of custom `documenting` cfg.
8+
- Bump `gloo` from 0.11 to 0.12.
9+
310
### v0.1.0
411

512
- Copied existing implementation from Yew.

Cargo.toml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
[package]
22
name = "tokise"
3-
version = "0.2.1"
3+
version = "0.3.0"
44
authors = ["Kaede Hoshikawa <futursolo@icloud.com>", "Elina <imelina@elina.website>"]
5-
edition = "2021"
5+
edition = "2024"
66
license = "MIT OR Apache-2.0"
77
readme = "README.md"
88
keywords = ["yew", "futures", "async", "io"]
99
categories = ["asynchronous"]
1010
description = "An asynchronous runtime compatible with WebAssembly and non-WebAssembly targets."
1111
repository = "https://github.com/yewstack/tokise"
12-
rust-version = "1.60.0"
12+
rust-version = "1.85"
1313

1414
[dependencies]
1515
futures = { version = "0.3", default-features = false, features = [
@@ -18,11 +18,10 @@ futures = { version = "0.3", default-features = false, features = [
1818
] }
1919
pin-project = "1.0.11"
2020
pinned = "0.1.0"
21-
once_cell = "1"
2221

2322
[target.'cfg(all(target_arch = "wasm32", not(target_os = "wasi")))'.dependencies]
2423
wasm-bindgen-futures = { version = "0.4" }
25-
gloo = { version = "0.11" }
24+
gloo = { version = "0.12" }
2625

2726
[target.'cfg(any(not(target_arch = "wasm32"), target_os = "wasi"))'.dependencies]
2827
tokio = { version = "1.35", features = ["rt", "time"] }
@@ -39,4 +38,4 @@ default = []
3938

4039
[package.metadata.docs.rs]
4140
all-features = true
42-
rustdoc-args = ["--cfg", "documenting"]
41+
rustdoc-args = ["--cfg", "docsrs"]

src/fmt/mod.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
//! Asynchronous utilities to work with `String`s.
22
3-
use std::future::Future;
4-
3+
use futures::StreamExt;
54
use futures::future::{self, MaybeDone};
65
use futures::stream::{FusedStream, Stream};
7-
use futures::StreamExt;
86
use pin_project::pin_project;
97

108
mod buffer;
119

12-
pub use buffer::{buffer, BufReader, BufWriter};
10+
pub use buffer::{BufReader, BufWriter, buffer};
1311

1412
/// A buffered asynchronous [`String`] [`Stream`](futures::stream::Stream).
1513
///

src/lib.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,8 @@
4242
//! - `wasm-bindgen-futures` (WebAssembly targets)
4343
//! - `tokio` (non-WebAssembly targets)
4444
45-
#![cfg_attr(documenting, feature(doc_cfg))]
46-
#![deny(
47-
missing_docs,
48-
missing_debug_implementations,
49-
bare_trait_objects,
50-
anonymous_parameters,
51-
elided_lifetimes_in_paths
52-
)]
45+
#![cfg_attr(docsrs, feature(doc_cfg))]
46+
#![deny(missing_docs, missing_debug_implementations, elided_lifetimes_in_paths)]
5347

5448
pub mod fmt;
5549
pub mod pinned;

src/pinned.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
//! This module provides the following task synchronisation mechanisms for `!Send` futures:
44
//!
55
//! - [`Barrier`]: Ensures multiple tasks to wait until all tasks have reached a point in the
6-
//! program before continuing execution of all together.
6+
//! program before continuing execution of all together.
77
//! - [`RwLock`]: Provides a mutual exclusion mechanism which allows multiple readers at the same
8-
//! time, while allowing only one writer at a time.
8+
//! time, while allowing only one writer at a time.
99
//! - [`mpsc`]: A channel that supports sending multiple values from multiple producers to a single
10-
//! receiver.
10+
//! receiver.
1111
//! - [`oneshot`]: A channel to send one single value from a producer to a receiver.
1212
1313
#[doc(inline)]

src/rt_tokio/local_worker.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
//! unwinding.
88
99
use std::cell::RefCell;
10-
use std::future::Future;
1110
use std::marker::PhantomData;
1211
use std::sync::Arc;
1312
use std::{io, thread};
@@ -18,12 +17,12 @@ use std::sync::atomic::{AtomicUsize, Ordering};
1817

1918
use futures::channel::mpsc::UnboundedSender;
2019
use futures::stream::StreamExt;
21-
use tokio::task::{spawn_local, LocalSet};
20+
use tokio::task::{LocalSet, spawn_local};
2221

2322
type SpawnTask = Box<dyn Send + FnOnce()>;
2423

2524
thread_local! {
26-
static TASK_COUNT: RefCell<Option<Arc<AtomicUsize>>> = RefCell::new(None);
25+
static TASK_COUNT: RefCell<Option<Arc<AtomicUsize>>> = const { RefCell::new(None) };
2726
static LOCAL_SET: LocalSet = LocalSet::new();
2827
}
2928

src/rt_tokio/mod.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
use std::future::Future;
2-
use std::sync::Arc;
1+
use std::sync::{Arc, LazyLock};
32
use std::{fmt, io};
43

5-
use once_cell::sync::Lazy;
6-
74
pub(crate) mod time;
85

96
mod local_worker;
@@ -56,7 +53,7 @@ impl fmt::Debug for Runtime {
5653

5754
impl Default for Runtime {
5855
fn default() -> Self {
59-
static DEFAULT_RT: Lazy<Runtime> = Lazy::new(|| {
56+
static DEFAULT_RT: LazyLock<Runtime> = LazyLock::new(|| {
6057
Runtime::new(get_default_runtime_size()).expect("failed to create runtime.")
6158
});
6259

src/rt_tokio/time.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use std::future::Future;
21
use std::time::Duration;
32

43
use futures::stream::{Stream, StreamExt};

src/rt_wasm_bindgen/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use std::future::Future;
21
use std::io;
32
use std::marker::PhantomData;
43

0 commit comments

Comments
 (0)