- Suppress warning from the cfg(loom) directive by having it emit
"rustc-check-cfg" in build.rs
- Remove usage of legacy "std::usize" module.
- Ignore "clippy::multiple_bound_locations". We use multiple bounds as a
workaround for an issue in pin-project-lite where only one bound can be
assigned per location. The phrasing of pin-project-lite's README implies that
this issue is WONTFIX. To quote:
> This library does not tackle as expansive of a range of use cases as
> pin-project does. If your use case is not already covered, please use
> pin-project.
Signed-off-by: John Nunley <dev@notgull.net>
This commit adds tests to CI that tests new patches for event-listener
with dependent crates. Examples of these dependent crates are:
- event-listener-strategy
- async-channel
- async-lock
Signed-off-by: John Nunley <dev@notgull.net>
This commit makes the panic message for a listener that's not inserted
into the linked list much clearer. The goal is to convey to the user
that they may be `poll`ing the listener after it has completed.
This commit also fixes some new Clippy lints.
cc #124
Signed-off-by: John Nunley <dev@notgull.net>
* Make sure Unpin is implemented for StackListener
* Purge the prelude
* Remove unused imports from doctests
Signed-off-by: John Nunley <dev@notgull.net>
Minimal amount of changes to make EventListener a heap-allocated type
again. The existence of the EventListener implies that it is already
listening; accordingly the new() and listen() methods on EventListener
have been removed.
cc #104
Signed-off-by: John Nunley <dev@notgull.net>
This commit makes it so EventListener::listen() does not overwrite
existing listeners if they already exist. If the listener is already
registered in an event listener list, it removes the listener from that
list before registering the new listener. This soundness bug was missed
during #94.
This is a patch-compatible fix for #100. We may also want an API-level
fix for #100 as well. This is up for further discussion.
Signed-off-by: John Nunley <dev@notgull.net>
This is a breaking change. It makes `new()` take no parameters in its
signature and `listen()` take a reference to an event in its signature.
This should avoid a footgun where a listener can be waited on without
listening on it.
Closes#91
Signed-off-by: John Nunley <dev@notgull.net>
In retrospect it is sometimes unclear in the documentation that the new event
listener needs to be pinned and inserted into the list before it can receive
events. This PR adds documentation that should clarify this issue.
Closes#89
Signed-off-by: John Nunley <dev@notgull.net>
This commit adds WASM compilation support to this crate. The main thing
is that the wait() family of APIs are removed in WASM mode, as blocking
is not allowed in WASM.
In addition, tests are added to CI to support WASM.
Signed-off-by: John Nunley <dev@notgull.net>