6617: Avoid string allocations in ignore_test r=lnicola a=lnicola

CC @jakobhellermann

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
This commit is contained in:
bors[bot] 2020-11-24 10:10:05 +00:00 committed by GitHub
commit 2d2615db15
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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 has_ignore_attribute(fn_def: &ast::Fn) -> Option<ast::Attr> {
fn_def.attrs().find_map(|attr| { fn_def.attrs().find_map(|attr| {
if attr.path()?.syntax().text().to_string() == "ignore" { if attr.path()?.syntax().text() == "ignore" {
Some(attr) Some(attr)
} else { } else {
None None