From 56e3fbe588597847b508969b7e3243725f5a792c Mon Sep 17 00:00:00 2001
From: Aleksey Kladov <aleksey.kladov@gmail.com>
Date: Thu, 6 Feb 2020 23:59:27 +0100
Subject: A tiny bit more consistent API

---
 crates/ra_assists/src/assists/early_return.rs | 2 +-
 crates/ra_syntax/src/ast/make.rs              | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

(limited to 'crates')

diff --git a/crates/ra_assists/src/assists/early_return.rs b/crates/ra_assists/src/assists/early_return.rs
index 7d510b055..3169be2b9 100644
--- a/crates/ra_assists/src/assists/early_return.rs
+++ b/crates/ra_assists/src/assists/early_return.rs
@@ -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)) => {
diff --git a/crates/ra_syntax/src/ast/make.rs b/crates/ra_syntax/src/ast/make.rs
index 629503dc5..02966a3ff 100644
--- a/crates/ra_syntax/src/ast/make.rs
+++ b/crates/ra_syntax/src/ast/make.rs
@@ -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(),
-- 
cgit v1.2.3