Skip to content

Commit

Permalink
refactor(gstd): use waker-fn instead of unsafe code (#4271)
Browse files Browse the repository at this point in the history
  • Loading branch information
playX18 authored Oct 2, 2024
1 parent 80d46f4 commit f717377
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 41 deletions.
5 changes: 3 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions gstd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ hex = { workspace = true, features = ["alloc"] }
parity-scale-codec = { workspace = true, features = ["derive"] }
scale-info = { workspace = true, features = ["derive"] }
futures = { workspace = true, features = ["alloc"] }
waker-fn = "1.2.0"

[features]
#! ## Default features
Expand Down
2 changes: 1 addition & 1 deletion gstd/src/async_runtime/futures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ impl Task {
F: Future<Output = ()> + 'static,
{
Self {
waker: super::waker::empty(),
waker: waker_fn::waker_fn(|| {}),
future: future.boxed_local(),
lock_exceeded: false,
}
Expand Down
1 change: 0 additions & 1 deletion gstd/src/async_runtime/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
mod futures;
mod locks;
mod signals;
mod waker;

#[cfg(not(feature = "ethexe"))]
mod reply_hooks;
Expand Down
37 changes: 0 additions & 37 deletions gstd/src/async_runtime/waker.rs

This file was deleted.

0 comments on commit f717377

Please sign in to comment.