Add support for Yield
This commit is contained in:
parent
897b224b54
commit
1577cefad5
11
src/expr.rs
11
src/expr.rs
@ -181,6 +181,17 @@ pub fn format_expr(
|
||||
)
|
||||
}
|
||||
}
|
||||
ast::ExprKind::Yield(ref opt_expr) => {
|
||||
if let Some(ref expr) = *opt_expr {
|
||||
rewrite_unary_prefix(context, "yield ", &**expr, shape)
|
||||
} else {
|
||||
wrap_str(
|
||||
"yield".to_string(),
|
||||
context.config.max_width(),
|
||||
shape,
|
||||
)
|
||||
}
|
||||
}
|
||||
ast::ExprKind::Closure(capture, ref fn_decl, ref body, _) => {
|
||||
rewrite_closure(capture, fn_decl, body, expr.span, context, shape)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user