Comments (3)
If I were to expand the macro and accept the compiler's help, it works:
#[must_use]
fn count_down(
num: u32,
foo: Option<&str>,
) -> ::core::pin::Pin<Box<dyn ::core::future::Future<Output = ()> + ::core::marker::Send + '_>> {
Box::pin(async move {
if num == 0 {
return;
}
println!("{}, {:?}", num, foo);
count_down(num - 1, foo);
})
}
from async-recursion.
Looks like a duplicate of #34
from async-recursion.
Resolved in #38, released in v1.1.0.
from async-recursion.
Related Issues (12)
- Function Not Send? HOT 4
- Move documentation from crate root to macro? HOT 1
- Applying the '?' expression to an async function doesn't seem to work as intended. HOT 3
- Recursive async fns made with the macro are lacking `#[must_use]` HOT 1
- Using #[async_recursion] inside a declarative macro HOT 2
- It breaks when there is another "Box" HOT 1
- Doesn't handle references inside generics (e.g. Option) HOT 2
- `no_std` support HOT 3
- syn now requires additional features for parse_quote and parse HOT 2
- Add `'async_recursion` lifetime to generics HOT 4
- One More Case where 'async_recursion is required HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from async-recursion.