Skip to content

Commit

Permalink
Transform the inner expression of yield expressions (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
SabrinaJewson authored Mar 12, 2022
1 parent cb8a508 commit e1a6ae6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions async-stream-impl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ impl VisitMut for Scrub<'_> {
syn::Expr::Yield(yield_expr) => {
self.has_yielded = true;

syn::visit_mut::visit_expr_yield_mut(self, yield_expr);

let value_expr = yield_expr.expr.as_ref().unwrap_or(&self.unit);

// let ident = &self.yielder;
Expand Down
7 changes: 7 additions & 0 deletions async-stream/tests/try_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,10 @@ async fn multi_try() {
values
);
}

#[allow(unused)]
fn issue_65() -> impl Stream<Item = Result<u32, ()>> {
try_stream! {
yield Err(())?;
}
}

0 comments on commit e1a6ae6

Please sign in to comment.