Skip to content

Commit 2b5901f

Browse files
authored
Merge pull request #8 from async-rs/bin-docs
Bin docs
2 parents dad72fc + 25943cf commit 2b5901f

File tree

1 file changed

+18
-23
lines changed

1 file changed

+18
-23
lines changed

src/lib.rs

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,6 @@
2222
//! makes sense to apply that even to `fn main`. Unfortunately this would
2323
//! require compiler support to enable, so we've provided an experimental
2424
//! polyfill for it in the mean time.
25-
//!
26-
//! # Why isn't this crate part of async-std?
27-
//!
28-
//! We want to make sure `async-std`'s surface area is stable, and only includes
29-
//! things that would make sense to be part of "an async version of std".
30-
//! Language level support is really important, but _not_ part of the standard
31-
//! library.
32-
//!
33-
//! This has some distinct benefits: in particular it allows us to
34-
//! version both crates at a different pace. And as features are added to the
35-
//! language (or we decide they weren't a great idea after all), we can
36-
//! incrementally shrink the surface area of this crate.
37-
//!
38-
//! The other big benefit is that it allows libraries to depend on `async-std`
39-
//! without needing to pull in the rather heavy `syn`, `quote`, and
40-
//! `proc-macro2` crates. This should help keep compilation times snappy for
41-
//! everyone.
4225
4326
#![forbid(unsafe_code, future_incompatible, rust_2018_idioms)]
4427
#![deny(missing_debug_implementations, nonstandard_style)]
@@ -50,12 +33,16 @@ use proc_macro::TokenStream;
5033
use quote::{quote, quote_spanned};
5134
use syn::spanned::Spanned;
5235

53-
/// Defines the async main function.
36+
/// <span
37+
/// class="module-item stab portability"
38+
/// style="display: inline; border-radius: 3px; padding: 2px; font-size: 80%; line-height: 1.2;"
39+
/// ><code>attributes</code></span>
40+
/// Enables an async main function.
5441
///
5542
/// # Examples
5643
///
5744
/// ```ignore
58-
/// #[async_attributes::main]
45+
/// #[async_std::main]
5946
/// async fn main() -> std::io::Result<()> {
6047
/// Ok(())
6148
/// }
@@ -100,12 +87,16 @@ pub fn main(_attr: TokenStream, item: TokenStream) -> TokenStream {
10087
result.into()
10188
}
10289

103-
/// Creates an async unit test.
90+
/// <span
91+
/// class="module-item stab portability"
92+
/// style="display: inline; border-radius: 3px; padding: 2px; font-size: 80%; line-height: 1.2;"
93+
/// ><code>attributes</code></span>
94+
/// Enables an async test function.
10495
///
10596
/// # Examples
10697
///
10798
/// ```ignore
108-
/// #[async_attributes::test]
99+
/// #[async_std::test]
109100
/// async fn my_test() -> std::io::Result<()> {
110101
/// assert_eq!(2 * 2, 4);
111102
/// Ok(())
@@ -137,15 +128,19 @@ pub fn test(_attr: TokenStream, item: TokenStream) -> TokenStream {
137128
result.into()
138129
}
139130

140-
/// Creates an async benchmark.
131+
/// <span
132+
/// class="module-item stab portability"
133+
/// style="display: inline; border-radius: 3px; padding: 2px; font-size: 80%; line-height: 1.2;"
134+
/// ><code>attributes</code></span>
135+
/// Enables an async benchmark function.
141136
///
142137
/// # Examples
143138
///
144139
/// ```ignore
145140
/// #![feature(test)]
146141
/// extern crate test;
147142
///
148-
/// #[async_attributes::bench]
143+
/// #[async_std::bench]
149144
/// async fn bench_1(b: &mut test::Bencher) {
150145
/// b.iter(|| {
151146
/// println!("hello world");

0 commit comments

Comments
 (0)