From b764c38436fcb9426eb7da3be4f5fbcd63b316f5 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 28 Mar 2020 11:01:25 +0100 Subject: Start stdx This crate will hold everything to small to be worth publishing --- crates/ra_assists/src/handlers/introduce_variable.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ra_assists/src/handlers/introduce_variable.rs') diff --git a/crates/ra_assists/src/handlers/introduce_variable.rs b/crates/ra_assists/src/handlers/introduce_variable.rs index b453c51fb..1edbdc14c 100644 --- a/crates/ra_assists/src/handlers/introduce_variable.rs +++ b/crates/ra_assists/src/handlers/introduce_variable.rs @@ -1,4 +1,3 @@ -use format_buf::format; use ra_syntax::{ ast::{self, AstNode}, SyntaxKind::{ @@ -7,6 +6,7 @@ use ra_syntax::{ }, SyntaxNode, TextUnit, }; +use stdx::format_to; use test_utils::tested_by; use crate::{Assist, AssistCtx, AssistId}; @@ -52,7 +52,7 @@ pub(crate) fn introduce_variable(ctx: AssistCtx) -> Option { buf.push_str("let var_name = "); TextUnit::of_str("let ") }; - format!(buf, "{}", expr.syntax()); + format_to!(buf, "{}", expr.syntax()); let full_stmt = ast::ExprStmt::cast(anchor_stmt.clone()); let is_full_stmt = if let Some(expr_stmt) = &full_stmt { Some(expr.syntax().clone()) == expr_stmt.expr().map(|e| e.syntax().clone()) -- cgit v1.2.3