Repository: tokio-rs/tokio
File: tokio/src/macros/select.rs (Rust)

Code before:
        ///             }
        ///             _ = some_async_work() => {
        ///                 println!("operation completed");
        ///             }
        ///         }
        ///     }
        /// }
        /// ```
        /// # Alternatives from the Ecosystem
        ///
        /// The select! macro is a powerful tool for managing multiple asynchronous
        /// branches, enabling tasks to run concurrently within the same thread. However,
        /// its use can introduce challenges, particularly around cancellation safety, which
        /// can lead to subtle and hard-to-debug errors. For many use cases, ecosystem
        /// alternatives may be preferable as they mitigate these concerns by offering
        /// clearer syntax, more predictable control flow, and reducing the need to manually
        /// handle issues like fuse semantics or cancellation safety.
        ///
        /// ## Merging Streams
        ///
        /// For cases where `loop { select! { ... } }` is used to poll multiple tasks,
        /// stream merging offers a concise alternative, inherently handle cancellation-safe
        /// processing, removing the risk of data loss. Libraries like
        /// [`tokio_stream`](https://docs.rs/tokio-stream/latest/tokio_stream/),
        /// [`futures::stream`](https://docs.rs/futures/latest/futures/stream/) and
        /// [`futures_concurrency`](https://docs.rs/futures-concurrency/latest/futures_concurrency/)
        /// provide tools for merging streams and handling their outputs sequentially.
        ///
        /// ### Example with `select!`
        ///
        /// ```
        /// struct File;
        /// struct Channel;
        /// struct Socket;
        ///
        /// impl Socket {
        ///     async fn read_packet(&mut self) -> Vec<u8> {
        ///         vec![]
        ///     }
        /// }
        ///
        /// async fn read_send(_file: &mut File, _channel: &mut Channel) {
        ///     // do work that is not cancel safe
        /// }
        ///
        /// #[tokio::main]
        /// async fn main() {
        ///     // open our IO types
        ///     let mut file = File;
        ///     let mut channel = Channel;
        ///     let mut socket = Socket;

Review comment (suggestion):
Please double-check whether these links work without specifying the link. These are all available as dev-dependencies, so they might resolve without a https link.

If that doesn't work, then please move the address to a separate line:
```
Libraries such as [`tokio-stream`], [`futures::stream`], and [`futures-concurrency`]

[`tokio-stream`]: https://docs.rs/tokio-stream
```

Code after:
        ///             }
        ///             _ = some_async_work() => {
        ///                 println!("operation completed");
        ///             }
        ///         }
        ///     }
        /// }
        /// ```
        /// # Alternatives from the Ecosystem
        ///
        /// The `select!` macro is a powerful tool for managing multiple asynchronous
        /// branches, enabling tasks to run concurrently within the same thread. However,
        /// its use can introduce challenges, particularly around cancellation safety, which
        /// can lead to subtle and hard-to-debug errors. For many use cases, ecosystem
        /// alternatives may be preferable as they mitigate these concerns by offering
        /// clearer syntax, more predictable control flow, and reducing the need to manually
        /// handle issues like fuse semantics or cancellation safety.
        ///
        /// ## Merging Streams
        ///
        /// For cases where `loop { select! { ... } }` is used to poll multiple tasks,
        /// stream merging offers a concise alternative, inherently handle cancellation-safe
        /// processing, removing the risk of data loss. Libraries such as [`tokio_stream`],
        /// [`futures::stream`] and [`futures_concurrency`] provide tools for merging
        /// streams and handling their outputs sequentially.
        ///
        /// [`tokio_stream`]: https://docs.rs/tokio-stream/latest/tokio_stream/
        /// [`futures::stream`]: https://docs.rs/futures/latest/futures/stream/
        /// [`futures_concurrency`]: https://docs.rs/futures-concurrency/latest/futures_concurrency/
        ///
        /// ### Example with `select!`
        ///
        /// ```
        /// struct File;
        /// struct Channel;
        /// struct Socket;
        ///
        /// impl Socket {
        ///     async fn read_packet(&mut self) -> Vec<u8> {
        ///         vec![]
        ///     }
        /// }
        ///
        /// async fn read_send(_file: &mut File, _channel: &mut Channel) {
        ///     // do work that is not cancel safe
        /// }
        ///
        /// #[tokio::main]
        /// async fn main() {
        ///     // open our IO types
        ///     let mut file = File;