mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-09-07 00:00:08 +02:00
macros: render more comprehensible documentation for try_join! (#6841)
Signed-off-by: Rustin170506 <[email protected]>
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
macro_rules! doc {
|
||||||
|
($try_join:item) => {
|
||||||
/// Waits on multiple concurrent branches, returning when **all** branches
|
/// Waits on multiple concurrent branches, returning when **all** branches
|
||||||
/// complete with `Ok(_)` or on the first `Err(_)`.
|
/// complete with `Ok(_)` or on the first `Err(_)`.
|
||||||
///
|
///
|
||||||
@@ -100,7 +102,17 @@
|
|||||||
/// ```
|
/// ```
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
#[cfg_attr(docsrs, doc(cfg(feature = "macros")))]
|
#[cfg_attr(docsrs, doc(cfg(feature = "macros")))]
|
||||||
macro_rules! try_join {
|
$try_join
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(doc)]
|
||||||
|
doc! {macro_rules! try_join {
|
||||||
|
($($future:expr),*) => { unimplemented!() }
|
||||||
|
}}
|
||||||
|
|
||||||
|
#[cfg(not(doc))]
|
||||||
|
doc! {macro_rules! try_join {
|
||||||
(@ {
|
(@ {
|
||||||
// One `_` for each branch in the `try_join!` macro. This is not used once
|
// One `_` for each branch in the `try_join!` macro. This is not used once
|
||||||
// normalization is complete.
|
// normalization is complete.
|
||||||
@@ -215,4 +227,4 @@ macro_rules! try_join {
|
|||||||
};
|
};
|
||||||
|
|
||||||
() => { async { Ok(()) }.await }
|
() => { async { Ok(()) }.await }
|
||||||
}
|
}}
|
||||||
|
|||||||
Reference in New Issue
Block a user