Rename *Owner traits to Has*

This commit is contained in:
Lukas Wirth 2021-09-27 12:54:24 +02:00
parent a28c5d7311
commit b6ed91a6de
101 changed files with 393 additions and 397 deletions

View file

@ -1,6 +1,6 @@
use ide_db::SymbolKind;
use syntax::{
ast::{self, AttrsOwner, GenericParamsOwner, NameOwner},
ast::{self, HasAttrs, HasGenericParams, HasName},
match_ast, AstNode, AstToken, NodeOrToken, SourceFile, SyntaxNode, SyntaxToken, TextRange,
WalkEvent,
};
@ -74,11 +74,11 @@ pub(crate) fn file_structure(file: &SourceFile) -> Vec<StructureNode> {
}
fn structure_node(node: &SyntaxNode) -> Option<StructureNode> {
fn decl<N: NameOwner + AttrsOwner>(node: N, kind: StructureNodeKind) -> Option<StructureNode> {
fn decl<N: HasName + HasAttrs>(node: N, kind: StructureNodeKind) -> Option<StructureNode> {
decl_with_detail(&node, None, kind)
}
fn decl_with_type_ref<N: NameOwner + AttrsOwner>(
fn decl_with_type_ref<N: HasName + HasAttrs>(
node: &N,
type_ref: Option<ast::Type>,
kind: StructureNodeKind,
@ -91,7 +91,7 @@ fn structure_node(node: &SyntaxNode) -> Option<StructureNode> {
decl_with_detail(node, detail, kind)
}
fn decl_with_detail<N: NameOwner + AttrsOwner>(
fn decl_with_detail<N: HasName + HasAttrs>(
node: &N,
detail: Option<String>,
kind: StructureNodeKind,