@@ -84,7 +84,7 @@ fn check_directory(dir: &Path, bad: &mut bool) -> Result<(), Box<dyn Error>> {
84
84
}
85
85
86
86
fn cmark_check ( path : & Path , bad : & mut bool , contents : & str ) -> Result < ( ) , Box < dyn Error > > {
87
- use pulldown_cmark:: { BrokenLink , CodeBlockKind , Event , Options , Parser , Tag } ;
87
+ use pulldown_cmark:: { CodeBlockKind , Event , Options , Parser , Tag } ;
88
88
89
89
macro_rules! cmark_error {
90
90
( $bad: expr, $path: expr, $range: expr, $( $arg: tt) * ) => {
@@ -96,20 +96,7 @@ fn cmark_check(path: &Path, bad: &mut bool, contents: &str) -> Result<(), Box<dy
96
96
}
97
97
98
98
let options = Options :: all ( ) ;
99
- // Can't use `bad` because it would get captured in closure.
100
- let mut link_err = false ;
101
- let mut cb = |link : BrokenLink < ' _ > | {
102
- cmark_error ! (
103
- & mut link_err,
104
- path,
105
- link. span,
106
- "broken {:?} link (reference `{}`)" ,
107
- link. link_type,
108
- link. reference
109
- ) ;
110
- None
111
- } ;
112
- let parser = Parser :: new_with_broken_link_callback ( contents, options, Some ( & mut cb) ) ;
99
+ let parser = Parser :: new_ext ( contents, options) ;
113
100
114
101
for ( event, range) in parser. into_offset_iter ( ) {
115
102
match event {
@@ -135,6 +122,5 @@ fn cmark_check(path: &Path, bad: &mut bool, contents: &str) -> Result<(), Box<dy
135
122
_ => { }
136
123
}
137
124
}
138
- * bad |= link_err;
139
125
Ok ( ( ) )
140
126
}
0 commit comments