@@ -16,19 +16,19 @@ pub fn check(cx: &LateContext<'_>, attrs: &[Attribute]) {
1616struct BrokenLinkLoader {
1717 spans_broken_link : Vec < Span > ,
1818 active : bool ,
19- processing_title : bool ,
20- processing_link : bool ,
21- start_at : u32 ,
19+ processing_link_text : bool ,
20+ processing_link_url : bool ,
21+ start : u32 ,
2222}
2323
2424impl BrokenLinkLoader {
2525 fn collect_spans_broken_link ( attrs : & [ Attribute ] ) -> Vec < Span > {
2626 let mut loader = BrokenLinkLoader {
2727 spans_broken_link : vec ! [ ] ,
2828 active : false ,
29- processing_title : false ,
30- processing_link : false ,
31- start_at : 0_u32 ,
29+ processing_link_text : false ,
30+ processing_link_url : false ,
31+ start : 0_u32 ,
3232 } ;
3333 loader. scan_attrs ( attrs) ;
3434 loader. spans_broken_link
@@ -59,23 +59,23 @@ impl BrokenLinkLoader {
5959 for ( pos, c) in char_indices {
6060 if !self . active {
6161 if c == '[' {
62- self . processing_title = true ;
62+ self . processing_link_text = true ;
6363 self . active = true ;
64- self . start_at = attr_span. lo ( ) . 0 + u32:: try_from ( pos) . unwrap ( ) ;
64+ self . start = attr_span. lo ( ) . 0 + u32:: try_from ( pos) . unwrap ( ) ;
6565 }
6666 continue ;
6767 }
6868
69- if self . processing_title {
69+ if self . processing_link_text {
7070 if c == ']' {
71- self . processing_title = false ;
71+ self . processing_link_text = false ;
7272 }
7373 continue ;
7474 }
7575
76- if !self . processing_link {
76+ if !self . processing_link_url {
7777 if c == '(' {
78- self . processing_link = true ;
78+ self . processing_link_url = true ;
7979 } else {
8080 // not a real link, start lookup over again
8181 self . reset_lookup ( ) ;
@@ -92,13 +92,13 @@ impl BrokenLinkLoader {
9292 }
9393 }
9494
95- // If it got to the end of the line and it still processing link part,
95+ // If it got at the end of the line and it still processing a link part,
9696 // it means this is a broken link.
97- if self . active && self . processing_link && !no_url_curr_line {
97+ if self . active && self . processing_link_url && !no_url_curr_line {
9898 let pos_end_line = u32:: try_from ( the_str. len ( ) ) . unwrap ( ) - 1 ;
9999
100100 // +3 skips the opening delimiter
101- let start = BytePos ( self . start_at + 3 ) ;
101+ let start = BytePos ( self . start + 3 ) ;
102102 let end = start + BytePos ( pos_end_line) ;
103103
104104 let com_span = Span :: new ( start, end, attr_span. ctxt ( ) , attr_span. parent ( ) ) ;
@@ -108,8 +108,8 @@ impl BrokenLinkLoader {
108108 }
109109
110110 fn reset_lookup ( & mut self ) {
111- self . processing_link = false ;
111+ self . processing_link_url = false ;
112112 self . active = false ;
113- self . start_at = 0 ;
113+ self . start = 0 ;
114114 }
115115}
0 commit comments