aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists/src/handlers/add_custom_impl.rs
diff options
context:
space:
mode:
authorKirill Bulatov <[email protected]>2020-02-18 12:53:02 +0000
committerKirill Bulatov <[email protected]>2020-02-18 14:03:08 +0000
commitb8ddcb0652f3ec8683023afc1e1f5166d6a712f4 (patch)
treeea95a1e2083280d84e99f274e5b2b8b269545297 /crates/ra_assists/src/handlers/add_custom_impl.rs
parenteab80cd961919b9321e1d34343ae3f3adb0502e5 (diff)
Run cargo +nightly fix --clippy -Z unstable-options
Diffstat (limited to 'crates/ra_assists/src/handlers/add_custom_impl.rs')
-rw-r--r--crates/ra_assists/src/handlers/add_custom_impl.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_assists/src/handlers/add_custom_impl.rs b/crates/ra_assists/src/handlers/add_custom_impl.rs
index 7fdd816bf..4d3a72c18 100644
--- a/crates/ra_assists/src/handlers/add_custom_impl.rs
+++ b/crates/ra_assists/src/handlers/add_custom_impl.rs
@@ -45,7 +45,7 @@ pub(crate) fn add_custom_impl(ctx: AssistCtx) -> Option<Assist> {
45 let trait_token = 45 let trait_token =
46 ctx.token_at_offset().filter(|t| t.kind() == IDENT && *t.text() != attr_name).next()?; 46 ctx.token_at_offset().filter(|t| t.kind() == IDENT && *t.text() != attr_name).next()?;
47 47
48 let annotated = attr.syntax().siblings(Direction::Next).find_map(|s| ast::Name::cast(s))?; 48 let annotated = attr.syntax().siblings(Direction::Next).find_map(ast::Name::cast)?;
49 let annotated_name = annotated.syntax().text().to_string(); 49 let annotated_name = annotated.syntax().text().to_string();
50 let start_offset = annotated.syntax().parent()?.text_range().end(); 50 let start_offset = annotated.syntax().parent()?.text_range().end();
51 51
@@ -62,7 +62,7 @@ pub(crate) fn add_custom_impl(ctx: AssistCtx) -> Option<Assist> {
62 .filter_map(|t| t.into_token().map(|t| t.text().clone())) 62 .filter_map(|t| t.into_token().map(|t| t.text().clone()))
63 .filter(|t| t != trait_token.text()) 63 .filter(|t| t != trait_token.text())
64 .collect::<Vec<SmolStr>>(); 64 .collect::<Vec<SmolStr>>();
65 let has_more_derives = new_attr_input.len() > 0; 65 let has_more_derives = !new_attr_input.is_empty();
66 let new_attr_input = 66 let new_attr_input =
67 join(new_attr_input.iter()).separator(", ").surround_with("(", ")").to_string(); 67 join(new_attr_input.iter()).separator(", ").surround_with("(", ")").to_string();
68 let new_attr_input_len = new_attr_input.len(); 68 let new_attr_input_len = new_attr_input.len();