Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "loom" feature #24

Merged
merged 2 commits into from
Nov 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,15 @@ pin-project-lite = "0.2.12"

[features]
default = ["std"]
loom = ["event-listener/loom"]
std = ["event-listener/std"]

[dev-dependencies]
futures-lite = "2.0.0"

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(wasm_bindgen_unstable_test_coverage)'] }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, what's this about? Is that flag emitted by wasm_bindgen_test::test?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I'm not sure about this one. @daxpedda What is the intended solution here?


[target.'cfg(target_family = "wasm")'.dev-dependencies]
wasm-bindgen-test = "0.3.37"

Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ pub struct NonBlocking<'a> {
_marker: PhantomData<&'a mut &'a ()>,
}

impl<'a, 'evl> Strategy<'evl> for NonBlocking<'a> {
impl<'a> Strategy<'_> for NonBlocking<'a> {
type Context = Context<'a>;
type Future = EventListener;

Expand Down Expand Up @@ -492,7 +492,7 @@ pub struct Blocking {
}

#[cfg(all(feature = "std", not(target_family = "wasm")))]
impl<'evl> Strategy<'evl> for Blocking {
impl Strategy<'_> for Blocking {
type Context = ();
type Future = Ready;

Expand Down
2 changes: 2 additions & 0 deletions tests/easy_wrapper.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
//! Testing of the `easy_wrapper!` macro.

#![allow(clippy::multiple_bound_locations)]

use event_listener_strategy::{easy_wrapper, EventListenerFuture, Strategy};
use std::{marker::PhantomData, pin::Pin, task::Poll};

Expand Down