aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists/src/add_impl.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_assists/src/add_impl.rs')
-rw-r--r--crates/ra_assists/src/add_impl.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/crates/ra_assists/src/add_impl.rs b/crates/ra_assists/src/add_impl.rs
index 9a0cfb4e7..59ca88468 100644
--- a/crates/ra_assists/src/add_impl.rs
+++ b/crates/ra_assists/src/add_impl.rs
@@ -1,3 +1,5 @@
1use std::fmt::Write;
2
1use hir::db::HirDatabase; 3use hir::db::HirDatabase;
2use join_to_string::join; 4use join_to_string::join;
3use ra_syntax::{ 5use ra_syntax::{
@@ -17,7 +19,7 @@ pub(crate) fn add_impl(mut ctx: AssistCtx<impl HirDatabase>) -> Option<Assist> {
17 let mut buf = String::new(); 19 let mut buf = String::new();
18 buf.push_str("\n\nimpl"); 20 buf.push_str("\n\nimpl");
19 if let Some(type_params) = &type_params { 21 if let Some(type_params) = &type_params {
20 type_params.syntax().text().push_to(&mut buf); 22 write!(buf, "{}", type_params.syntax()).unwrap();
21 } 23 }
22 buf.push_str(" "); 24 buf.push_str(" ");
23 buf.push_str(name.text().as_str()); 25 buf.push_str(name.text().as_str());