mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 07:04:49 +00:00
Run cargo +nightly fix --clippy -Z unstable-options
This commit is contained in:
parent
eab80cd961
commit
b8ddcb0652
48 changed files with 132 additions and 149 deletions
|
@ -45,7 +45,7 @@ pub(crate) fn add_custom_impl(ctx: AssistCtx) -> Option<Assist> {
|
|||
let trait_token =
|
||||
ctx.token_at_offset().filter(|t| t.kind() == IDENT && *t.text() != attr_name).next()?;
|
||||
|
||||
let annotated = attr.syntax().siblings(Direction::Next).find_map(|s| ast::Name::cast(s))?;
|
||||
let annotated = attr.syntax().siblings(Direction::Next).find_map(ast::Name::cast)?;
|
||||
let annotated_name = annotated.syntax().text().to_string();
|
||||
let start_offset = annotated.syntax().parent()?.text_range().end();
|
||||
|
||||
|
@ -62,7 +62,7 @@ pub(crate) fn add_custom_impl(ctx: AssistCtx) -> Option<Assist> {
|
|||
.filter_map(|t| t.into_token().map(|t| t.text().clone()))
|
||||
.filter(|t| t != trait_token.text())
|
||||
.collect::<Vec<SmolStr>>();
|
||||
let has_more_derives = new_attr_input.len() > 0;
|
||||
let has_more_derives = !new_attr_input.is_empty();
|
||||
let new_attr_input =
|
||||
join(new_attr_input.iter()).separator(", ").surround_with("(", ")").to_string();
|
||||
let new_attr_input_len = new_attr_input.len();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue