We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 533ca58 commit b742dd3Copy full SHA for b742dd3
crates/ide_assists/src/utils.rs
@@ -74,7 +74,12 @@ pub fn extract_trivial_expression(block_expr: &ast::BlockExpr) -> Option<ast::Ex
74
pub fn test_related_attribute(fn_def: &ast::Fn) -> Option<ast::Attr> {
75
fn_def.attrs().find_map(|attr| {
76
let path = attr.path()?;
77
- path.syntax().text().to_string().contains("test").then(|| attr)
+ let text = path.syntax().text().to_string();
78
+ if text.starts_with("test") || text.ends_with("test") {
79
+ Some(attr)
80
+ } else {
81
+ None
82
+ }
83
})
84
}
85
0 commit comments