Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/syntax/src/ast/node_ext.rs')
-rw-r--r--crates/syntax/src/ast/node_ext.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/crates/syntax/src/ast/node_ext.rs b/crates/syntax/src/ast/node_ext.rs
index a253827495..a7e4899fb7 100644
--- a/crates/syntax/src/ast/node_ext.rs
+++ b/crates/syntax/src/ast/node_ext.rs
@@ -617,6 +617,16 @@ impl ast::Item {
}
}
+impl ast::Type {
+ pub fn generic_arg_list(&self) -> Option<ast::GenericArgList> {
+ if let ast::Type::PathType(path_type) = self {
+ path_type.path()?.segment()?.generic_arg_list()
+ } else {
+ None
+ }
+ }
+}
+
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum FieldKind {
Name(ast::NameRef),