Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-assists/src/utils.rs')
-rw-r--r--crates/ide-assists/src/utils.rs13
1 files changed, 2 insertions, 11 deletions
diff --git a/crates/ide-assists/src/utils.rs b/crates/ide-assists/src/utils.rs
index a00af92626..de8c4b6bca 100644
--- a/crates/ide-assists/src/utils.rs
+++ b/crates/ide-assists/src/utils.rs
@@ -101,16 +101,7 @@ pub fn test_related_attribute_syn(fn_def: &ast::Fn) -> Option<ast::Attr> {
}
pub fn has_test_related_attribute(attrs: &hir::AttrsWithOwner) -> bool {
- attrs.iter().any(|attr| {
- let path = attr.path();
- (|| {
- Some(
- path.segments().first()?.as_str().starts_with("test")
- || path.segments().last()?.as_str().ends_with("test"),
- )
- })()
- .unwrap_or_default()
- })
+ attrs.is_test()
}
#[derive(Clone, Copy, PartialEq)]
@@ -136,7 +127,7 @@ pub fn filter_assoc_items(
.copied()
.filter(|assoc_item| {
if ignore_items == IgnoreAssocItems::DocHiddenAttrPresent
- && assoc_item.attrs(sema.db).has_doc_hidden()
+ && assoc_item.attrs(sema.db).is_doc_hidden()
{
if let hir::AssocItem::Function(f) = assoc_item
&& !f.has_body(sema.db)