Skip to content

Commit

Permalink
fix: update doctests to use smol feature (#215)
Browse files Browse the repository at this point in the history
  • Loading branch information
sinui0 authored Jan 31, 2024
1 parent c836eb0 commit 8624d85
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions xtra/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,13 +291,12 @@ where
/// }
/// }
///
/// # #[cfg(feature = "with-smol-1")]
/// # smol::block_on(async {
/// let addr = MyActor.create(None).spawn(&mut xtra::spawn::Smol::Global);
/// assert!(addr.is_connected());
/// assert_eq!(addr.send(Selecting).await, Ok(true)); // Assert that the select did end early
/// # })
///
/// # #[cfg(feature = "smol")]
/// smol::block_on(async {
/// let addr = xtra::spawn_smol(MyActor, Mailbox::unbounded());
/// assert!(addr.is_connected());
/// assert_eq!(addr.send(Selecting).await, Ok(true)); // Assert that the select did end early
/// })
/// ```
pub async fn select<A, F, R>(mailbox: &Mailbox<A>, actor: &mut A, mut fut: F) -> Either<R, F>
where
Expand Down Expand Up @@ -368,12 +367,13 @@ where
/// }
/// }
///
/// # #[cfg(feature = "with-smol-1")]
/// # smol::block_on(async {
/// let addr = MyActor.create(None).spawn(&mut xtra::spawn::Smol::Global);
/// assert!(addr.is_connected());
/// assert_eq!(addr.send(Joining).await, Ok(true)); // Assert that the join did evaluate the future
/// # })
/// # #[cfg(feature = "smol")]
/// smol::block_on(async {
/// let addr = xtra::spawn_smol(MyActor, Mailbox::unbounded());
/// assert!(addr.is_connected());
/// assert_eq!(addr.send(Joining).await, Ok(true)); // Assert that the join did evaluate the future
/// })
/// ```
pub async fn join<A, F, R>(mailbox: &Mailbox<A>, actor: &mut A, fut: F) -> R
where
F: Future<Output = R>,
Expand Down

0 comments on commit 8624d85

Please sign in to comment.