Merge #3042
3042: A tiny bit more consistent API r=matklad a=matklad Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
commit
5aba5a756a
2 changed files with 2 additions and 2 deletions
|
@ -101,7 +101,7 @@ pub(crate) fn convert_to_guarded_return(ctx: AssistCtx) -> Option<Assist> {
|
|||
// If.
|
||||
let early_expression = &(early_expression.syntax().to_string() + ";");
|
||||
let new_expr = if_indent_level
|
||||
.increase_indent(make::if_expression(&cond_expr, early_expression));
|
||||
.increase_indent(make::if_expression(cond_expr, early_expression));
|
||||
replace(new_expr.syntax(), &then_block, &parent_block, &if_expr)
|
||||
}
|
||||
Some((path, bound_ident)) => {
|
||||
|
|
|
@ -158,7 +158,7 @@ pub fn where_clause(preds: impl IntoIterator<Item = ast::WherePred>) -> ast::Whe
|
|||
}
|
||||
}
|
||||
|
||||
pub fn if_expression(condition: &ast::Expr, statement: &str) -> ast::IfExpr {
|
||||
pub fn if_expression(condition: ast::Expr, statement: &str) -> ast::IfExpr {
|
||||
ast_from_text(&format!(
|
||||
"fn f() {{ if !{} {{\n {}\n}}\n}}",
|
||||
condition.syntax().text(),
|
||||
|
|
Loading…
Add table
Reference in a new issue