Skip to content

Commit b08c43a

Browse files
committed
doc: add reason why AFIT is not default mode for now
1 parent 282eb76 commit b08c43a

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
![Maintenance](https://img.shields.io/badge/maintenance-activly--developed-brightgreen.svg)
2-
31
# maybe-async
42

53
**Why bother writing similar code twice for blocking and async code?**
@@ -294,5 +292,3 @@ gate when we add `maybe-async` to dependency.
294292

295293
## License
296294
MIT
297-
298-
License: MIT

README.tpl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# {{crate}}
2+
3+
{{readme}}

src/lib.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@
9595
//!
9696
//! AFIT is acronym for **a**sync **f**unction **i**n **t**rait, stabilized from rust 1.74
9797
//!
98+
//! 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.
100+
//!
98101
//! - `must_be_async`
99102
//!
100103
//! **Keep async**.
@@ -177,7 +180,7 @@
177180
//! gate set or not.
178181
//!
179182
//! ```rust
180-
//! #[maybe_async::maybe_async(?Send)]
183+
//! #[maybe_async::maybe_async(AFIT)]
181184
//! trait A {
182185
//! async fn async_fn_name() -> Result<(), ()> {
183186
//! Ok(())
@@ -189,7 +192,7 @@
189192
//!
190193
//! struct Foo;
191194
//!
192-
//! #[maybe_async::maybe_async(?Send)]
195+
//! #[maybe_async::maybe_async(AFIT)]
193196
//! impl A for Foo {
194197
//! async fn async_fn_name() -> Result<(), ()> {
195198
//! Ok(())
@@ -213,7 +216,6 @@
213216
//!
214217
//! ```rust
215218
//! // Compiled code when `is_sync` is toggled off.
216-
//! #[async_trait::async_trait(?Send)]
217219
//! trait A {
218220
//! async fn maybe_async_fn_name() -> Result<(), ()> {
219221
//! Ok(())
@@ -225,7 +227,6 @@
225227
//!
226228
//! struct Foo;
227229
//!
228-
//! #[async_trait::async_trait(?Send)]
229230
//! impl A for Foo {
230231
//! async fn maybe_async_fn_name() -> Result<(), ()> {
231232
//! Ok(())

0 commit comments

Comments
 (0)