aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src/attr.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_def/src/attr.rs')
-rw-r--r--crates/hir_def/src/attr.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/hir_def/src/attr.rs b/crates/hir_def/src/attr.rs
index d9f9fadc1..d07adb084 100644
--- a/crates/hir_def/src/attr.rs
+++ b/crates/hir_def/src/attr.rs
@@ -583,13 +583,13 @@ impl AttrSourceMap {
583 .get(id.ast_index as usize) 583 .get(id.ast_index as usize)
584 .unwrap_or_else(|| panic!("cannot find doc comment at index {:?}", id)) 584 .unwrap_or_else(|| panic!("cannot find doc comment at index {:?}", id))
585 .clone() 585 .clone()
586 .map(|attr| Either::Right(attr)) 586 .map(Either::Right)
587 } else { 587 } else {
588 self.attrs 588 self.attrs
589 .get(id.ast_index as usize) 589 .get(id.ast_index as usize)
590 .unwrap_or_else(|| panic!("cannot find `Attr` at index {:?}", id)) 590 .unwrap_or_else(|| panic!("cannot find `Attr` at index {:?}", id))
591 .clone() 591 .clone()
592 .map(|attr| Either::Left(attr)) 592 .map(Either::Left)
593 } 593 }
594 } 594 }
595} 595}
@@ -606,7 +606,7 @@ pub struct DocsRangeMap {
606impl DocsRangeMap { 606impl DocsRangeMap {
607 pub fn map(&self, range: TextRange) -> Option<InFile<TextRange>> { 607 pub fn map(&self, range: TextRange) -> Option<InFile<TextRange>> {
608 let found = self.mapping.binary_search_by(|(probe, ..)| probe.ordering(range)).ok()?; 608 let found = self.mapping.binary_search_by(|(probe, ..)| probe.ordering(range)).ok()?;
609 let (line_docs_range, idx, original_line_src_range) = self.mapping[found].clone(); 609 let (line_docs_range, idx, original_line_src_range) = self.mapping[found];
610 if !line_docs_range.contains_range(range) { 610 if !line_docs_range.contains_range(range) {
611 return None; 611 return None;
612 } 612 }