Skip to content

Conversation

@withoutboats
Copy link
Owner

@withoutboats withoutboats commented Aug 17, 2020

Takes advantage of fehler's propane integration to make propane
generators Ok-wrapping.

Syntax:

use std::future::Future;
use std::io;

#[propane::generator(throws io::Error)]
async fn foo<T: Future<Output = io::Result<i32>>>(futures: Vec<T>) -> i32 {
    let mut n = 0;
    for x in futures {
       yield x.await?;

       yield n;
       n += 1;
    }
}

Takes advantage of fehler's propane integration to make propane
generators Ok-wrapping.

Syntax:

```rust
fn foo<T: Future<Output = io::Result<i32>>>(futures: Vec<T>) -> i32 {
    let mut n = 0;
    for x in futures {
       yield x.await?;

       yield n;
       n += 1;
    }
}
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants