Avoid string allocations in ignore_test

This commit is contained in:
Laurențiu Nicola 2020-11-24 12:08:54 +02:00
parent 6294286fee
commit 8af1ed6a09

View file

@ -56,7 +56,7 @@ pub(crate) fn ignore_test(acc: &mut Assists, ctx: &AssistContext) -> Option<()>
fn has_ignore_attribute(fn_def: &ast::Fn) -> Option<ast::Attr> {
fn_def.attrs().find_map(|attr| {
if attr.path()?.syntax().text().to_string() == "ignore" {
if attr.path()?.syntax().text() == "ignore" {
Some(attr)
} else {
None