From 0343c4a815a0e82d5e55e76a01d21b0f7a00ff5b Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 19 Jul 2019 11:24:41 +0300 Subject: migrate ra_assists to the new AST --- crates/ra_assists/src/add_impl.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/ra_assists/src/add_impl.rs') diff --git a/crates/ra_assists/src/add_impl.rs b/crates/ra_assists/src/add_impl.rs index b81922c1d..cebc19539 100644 --- a/crates/ra_assists/src/add_impl.rs +++ b/crates/ra_assists/src/add_impl.rs @@ -16,7 +16,7 @@ pub(crate) fn add_impl(mut ctx: AssistCtx) -> Option { let start_offset = nominal.syntax().range().end(); let mut buf = String::new(); buf.push_str("\n\nimpl"); - if let Some(type_params) = type_params { + if let Some(type_params) = &type_params { type_params.syntax().text().push_to(&mut buf); } buf.push_str(" "); @@ -25,9 +25,9 @@ pub(crate) fn add_impl(mut ctx: AssistCtx) -> Option { let lifetime_params = type_params .lifetime_params() .filter_map(|it| it.lifetime_token()) - .map(|it| it.text()); + .map(|it| it.text().clone()); let type_params = - type_params.type_params().filter_map(|it| it.name()).map(|it| it.text()); + type_params.type_params().filter_map(|it| it.name()).map(|it| it.text().clone()); join(lifetime_params.chain(type_params)).surround_with("<", ">").to_buf(&mut buf); } buf.push_str(" {\n"); -- cgit v1.2.3