From 88cb9e8e0da47bf962802277a03928fe461f2cd2 Mon Sep 17 00:00:00 2001 From: Yoshua Wuyts Date: Tue, 24 Sep 2019 14:22:28 +0200 Subject: [PATCH 1/2] show bin in docs Signed-off-by: Yoshua Wuyts --- src/lib.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 77ecd8a..13d59c2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -50,6 +50,10 @@ use proc_macro::TokenStream; use quote::{quote, quote_spanned}; use syn::spanned::Spanned; +/// bin /// Defines the async main function. /// /// # Examples @@ -100,6 +104,10 @@ pub fn main(_attr: TokenStream, item: TokenStream) -> TokenStream { result.into() } +/// bin /// Creates an async unit test. /// /// # Examples @@ -137,6 +145,10 @@ pub fn test(_attr: TokenStream, item: TokenStream) -> TokenStream { result.into() } +/// bin /// Creates an async benchmark. /// /// # Examples From 25943cf387d8f486f064177f81e39f2c79bd407f Mon Sep 17 00:00:00 2001 From: Yoshua Wuyts Date: Sun, 3 Nov 2019 00:20:28 +0100 Subject: [PATCH 2/2] rename bin docs to attribute docs Signed-off-by: Yoshua Wuyts --- src/lib.rs | 35 +++++++++-------------------------- 1 file changed, 9 insertions(+), 26 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 13d59c2..fe17176 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -22,23 +22,6 @@ //! makes sense to apply that even to `fn main`. Unfortunately this would //! require compiler support to enable, so we've provided an experimental //! polyfill for it in the mean time. -//! -//! # Why isn't this crate part of async-std? -//! -//! We want to make sure `async-std`'s surface area is stable, and only includes -//! things that would make sense to be part of "an async version of std". -//! Language level support is really important, but _not_ part of the standard -//! library. -//! -//! This has some distinct benefits: in particular it allows us to -//! version both crates at a different pace. And as features are added to the -//! language (or we decide they weren't a great idea after all), we can -//! incrementally shrink the surface area of this crate. -//! -//! The other big benefit is that it allows libraries to depend on `async-std` -//! without needing to pull in the rather heavy `syn`, `quote`, and -//! `proc-macro2` crates. This should help keep compilation times snappy for -//! everyone. #![forbid(unsafe_code, future_incompatible, rust_2018_idioms)] #![deny(missing_debug_implementations, nonstandard_style)] @@ -53,13 +36,13 @@ use syn::spanned::Spanned; /// bin -/// Defines the async main function. +/// >attributes +/// Enables an async main function. /// /// # Examples /// /// ```ignore -/// #[async_attributes::main] +/// #[async_std::main] /// async fn main() -> std::io::Result<()> { /// Ok(()) /// } @@ -107,13 +90,13 @@ pub fn main(_attr: TokenStream, item: TokenStream) -> TokenStream { /// bin -/// Creates an async unit test. +/// >attributes +/// Enables an async test function. /// /// # Examples /// /// ```ignore -/// #[async_attributes::test] +/// #[async_std::test] /// async fn my_test() -> std::io::Result<()> { /// assert_eq!(2 * 2, 4); /// Ok(()) @@ -148,8 +131,8 @@ pub fn test(_attr: TokenStream, item: TokenStream) -> TokenStream { /// bin -/// Creates an async benchmark. +/// >attributes +/// Enables an async benchmark function. /// /// # Examples /// @@ -157,7 +140,7 @@ pub fn test(_attr: TokenStream, item: TokenStream) -> TokenStream { /// #![feature(test)] /// extern crate test; /// -/// #[async_attributes::bench] +/// #[async_std::bench] /// async fn bench_1(b: &mut test::Bencher) { /// b.iter(|| { /// println!("hello world");