Skip to content

Commit 3f7c617

Browse files
committed
doc: refine wording
1 parent b08c43a commit 3f7c617

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ blocking code except for async/await keywords. And use feature gate
8080
maybe_async = { version = "0.2", features = ["is_sync"] }
8181
```
8282

83-
There are three usage variants for `maybe_async` attribute macros:
83+
There are three usage variants for `maybe_async` attribute usage:
8484
- `#[maybe_async]` or `#[maybe_async(Send)]`
8585

8686
In this mode, `#[async_trait::async_trait]` is added to trait declarations and trait implementations
@@ -97,11 +97,14 @@ blocking code except for async/await keywords. And use feature gate
9797

9898
AFIT is acronym for **a**sync **f**unction **i**n **t**rait, stabilized from rust 1.74
9999

100+
For compatibility reasons, the `async fn` in traits is supported via a verbose `AFIT` flag. This will become
101+
the default mode for the next major release.
102+
100103
- `must_be_async`
101104

102105
**Keep async**.
103106

104-
There are three usage variants for `must_be_async` attribute macros:
107+
There are three usage variants for `must_be_async` attribute usage:
105108
- `#[must_be_async]` or `#[must_be_async(Send)]`
106109
- `#[must_be_async(?Send)]`
107110
- `#[must_be_async(AFIT)]`
@@ -130,7 +133,7 @@ blocking code except for async/await keywords. And use feature gate
130133
An async implementation should on compile on async implementation and
131134
must simply disappear when we want sync version.
132135

133-
There are three usage variants for `async_impl` attribute macros:
136+
There are three usage variants for `async_impl` attribute usage:
134137
- `#[async_impl]` or `#[async_impl(Send)]`
135138
- `#[async_impl(?Send)]`
136139
- `#[async_impl(AFIT)]`
@@ -179,7 +182,7 @@ Here is a detailed example on what's going on whe the `is_sync` feature
179182
gate set or not.
180183

181184
```rust
182-
#[maybe_async::maybe_async(?Send)]
185+
#[maybe_async::maybe_async(AFIT)]
183186
trait A {
184187
async fn async_fn_name() -> Result<(), ()> {
185188
Ok(())
@@ -191,7 +194,7 @@ trait A {
191194

192195
struct Foo;
193196

194-
#[maybe_async::maybe_async(?Send)]
197+
#[maybe_async::maybe_async(AFIT)]
195198
impl A for Foo {
196199
async fn async_fn_name() -> Result<(), ()> {
197200
Ok(())
@@ -215,7 +218,6 @@ is async code:
215218

216219
```rust
217220
// Compiled code when `is_sync` is toggled off.
218-
#[async_trait::async_trait(?Send)]
219221
trait A {
220222
async fn maybe_async_fn_name() -> Result<(), ()> {
221223
Ok(())
@@ -227,7 +229,6 @@ trait A {
227229

228230
struct Foo;
229231

230-
#[async_trait::async_trait(?Send)]
231232
impl A for Foo {
232233
async fn maybe_async_fn_name() -> Result<(), ()> {
233234
Ok(())

src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
//! maybe_async = { version = "0.2", features = ["is_sync"] }
7979
//! ```
8080
//!
81-
//! There are three usage variants for `maybe_async` attribute macros:
81+
//! There are three usage variants for `maybe_async` attribute usage:
8282
//! - `#[maybe_async]` or `#[maybe_async(Send)]`
8383
//!
8484
//! In this mode, `#[async_trait::async_trait]` is added to trait declarations and trait implementations
@@ -96,13 +96,13 @@
9696
//! AFIT is acronym for **a**sync **f**unction **i**n **t**rait, stabilized from rust 1.74
9797
//!
9898
//! For compatibility reasons, the `async fn` in traits is supported via a verbose `AFIT` flag. This will become
99-
//! the default mode for next major release.
99+
//! the default mode for the next major release.
100100
//!
101101
//! - `must_be_async`
102102
//!
103103
//! **Keep async**.
104104
//!
105-
//! There are three usage variants for `must_be_async` attribute macros:
105+
//! There are three usage variants for `must_be_async` attribute usage:
106106
//! - `#[must_be_async]` or `#[must_be_async(Send)]`
107107
//! - `#[must_be_async(?Send)]`
108108
//! - `#[must_be_async(AFIT)]`
@@ -131,7 +131,7 @@
131131
//! An async implementation should on compile on async implementation and
132132
//! must simply disappear when we want sync version.
133133
//!
134-
//! There are three usage variants for `async_impl` attribute macros:
134+
//! There are three usage variants for `async_impl` attribute usage:
135135
//! - `#[async_impl]` or `#[async_impl(Send)]`
136136
//! - `#[async_impl(?Send)]`
137137
//! - `#[async_impl(AFIT)]`

0 commit comments

Comments
 (0)