aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/ast/traits.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-04-09 22:47:34 +0100
committerGitHub <[email protected]>2020-04-09 22:47:34 +0100
commit176f7f61175bc433c56083a758bd7a28a8ae31f8 (patch)
treecca4821454502279317323fbc63dccdb9c68c5b9 /crates/ra_syntax/src/ast/traits.rs
parenteb07803e8106a66edfd80d078337dae240e92828 (diff)
parent30084a56a5731343bd4cec727646a6c55900234f (diff)
Merge #3923
3923: Cleanup keyword accessors r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_syntax/src/ast/traits.rs')
-rw-r--r--crates/ra_syntax/src/ast/traits.rs12
1 files changed, 3 insertions, 9 deletions
diff --git a/crates/ra_syntax/src/ast/traits.rs b/crates/ra_syntax/src/ast/traits.rs
index f6c786e44..4ed7cf73b 100644
--- a/crates/ra_syntax/src/ast/traits.rs
+++ b/crates/ra_syntax/src/ast/traits.rs
@@ -1,8 +1,7 @@
1//! Various traits that are implemented by ast nodes. 1//! Various traits that are implemented by ast nodes.
2//! 2//!
3//! The implementations are usually trivial, and live in generated.rs 3//! The implementations are usually trivial, and live in generated.rs
4 4use stdx::SepBy;
5use itertools::Itertools;
6 5
7use crate::{ 6use crate::{
8 ast::{self, support, AstChildren, AstNode, AstToken}, 7 ast::{self, support, AstChildren, AstNode, AstToken},
@@ -43,12 +42,6 @@ pub trait ArgListOwner: AstNode {
43 } 42 }
44} 43}
45 44
46pub trait FnDefOwner: AstNode {
47 fn functions(&self) -> AstChildren<ast::FnDef> {
48 support::children(self.syntax())
49 }
50}
51
52pub trait ModuleItemOwner: AstNode { 45pub trait ModuleItemOwner: AstNode {
53 fn items(&self) -> AstChildren<ast::ModuleItem> { 46 fn items(&self) -> AstChildren<ast::ModuleItem> {
54 support::children(self.syntax()) 47 support::children(self.syntax())
@@ -122,7 +115,8 @@ pub trait DocCommentsOwner: AstNode {
122 // of a line in markdown. 115 // of a line in markdown.
123 line[pos..end].to_owned() 116 line[pos..end].to_owned()
124 }) 117 })
125 .join("\n"); 118 .sep_by("\n")
119 .to_string();
126 120
127 if has_comments { 121 if has_comments {
128 Some(docs) 122 Some(docs)