aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_expand/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_expand/src/lib.rs')
-rw-r--r--crates/ra_hir_expand/src/lib.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_hir_expand/src/lib.rs b/crates/ra_hir_expand/src/lib.rs
index 7b72eb7a0..6b59ea4c9 100644
--- a/crates/ra_hir_expand/src/lib.rs
+++ b/crates/ra_hir_expand/src/lib.rs
@@ -366,7 +366,7 @@ impl<T> InFile<T> {
366 pub fn as_ref(&self) -> InFile<&T> { 366 pub fn as_ref(&self) -> InFile<&T> {
367 self.with_value(&self.value) 367 self.with_value(&self.value)
368 } 368 }
369 pub fn file_syntax(&self, db: &impl db::AstDatabase) -> SyntaxNode { 369 pub fn file_syntax(&self, db: &dyn db::AstDatabase) -> SyntaxNode {
370 db.parse_or_expand(self.file_id).expect("source created from invalid file") 370 db.parse_or_expand(self.file_id).expect("source created from invalid file")
371 } 371 }
372} 372}
@@ -387,7 +387,7 @@ impl<T> InFile<Option<T>> {
387impl InFile<SyntaxNode> { 387impl InFile<SyntaxNode> {
388 pub fn ancestors_with_macros( 388 pub fn ancestors_with_macros(
389 self, 389 self,
390 db: &impl crate::db::AstDatabase, 390 db: &dyn db::AstDatabase,
391 ) -> impl Iterator<Item = InFile<SyntaxNode>> + '_ { 391 ) -> impl Iterator<Item = InFile<SyntaxNode>> + '_ {
392 std::iter::successors(Some(self), move |node| match node.value.parent() { 392 std::iter::successors(Some(self), move |node| match node.value.parent() {
393 Some(parent) => Some(node.with_value(parent)), 393 Some(parent) => Some(node.with_value(parent)),
@@ -402,7 +402,7 @@ impl InFile<SyntaxNode> {
402impl InFile<SyntaxToken> { 402impl InFile<SyntaxToken> {
403 pub fn ancestors_with_macros( 403 pub fn ancestors_with_macros(
404 self, 404 self,
405 db: &impl crate::db::AstDatabase, 405 db: &dyn db::AstDatabase,
406 ) -> impl Iterator<Item = InFile<SyntaxNode>> + '_ { 406 ) -> impl Iterator<Item = InFile<SyntaxNode>> + '_ {
407 self.map(|it| it.parent()).ancestors_with_macros(db) 407 self.map(|it| it.parent()).ancestors_with_macros(db)
408 } 408 }