Skip to content

Commit 5aba5a7

Browse files
bors[bot]matklad
andauthored
Merge #3042
3042: A tiny bit more consistent API r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
2 parents a4431e8 + 56e3fbe commit 5aba5a7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

crates/ra_assists/src/assists/early_return.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ pub(crate) fn convert_to_guarded_return(ctx: AssistCtx) -> Option<Assist> {
101101
// If.
102102
let early_expression = &(early_expression.syntax().to_string() + ";");
103103
let new_expr = if_indent_level
104-
.increase_indent(make::if_expression(&cond_expr, early_expression));
104+
.increase_indent(make::if_expression(cond_expr, early_expression));
105105
replace(new_expr.syntax(), &then_block, &parent_block, &if_expr)
106106
}
107107
Some((path, bound_ident)) => {

crates/ra_syntax/src/ast/make.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ pub fn where_clause(preds: impl IntoIterator<Item = ast::WherePred>) -> ast::Whe
158158
}
159159
}
160160

161-
pub fn if_expression(condition: &ast::Expr, statement: &str) -> ast::IfExpr {
161+
pub fn if_expression(condition: ast::Expr, statement: &str) -> ast::IfExpr {
162162
ast_from_text(&format!(
163163
"fn f() {{ if !{} {{\n {}\n}}\n}}",
164164
condition.syntax().text(),

0 commit comments

Comments
 (0)