Run cargo +nightly fix --clippy -Z unstable-options

This commit is contained in:
Kirill Bulatov 2020-02-18 14:53:02 +02:00
parent eab80cd961
commit b8ddcb0652
48 changed files with 132 additions and 149 deletions

View file

@ -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();