, P: ParagraphWalker>(
}
for link in document
- .links::(&mut doc_buf, check_anchors, get_paragraphs)
+ .links::
(&mut doc_buf, check_anchors)
.with_context(|| format!("Failed to read file {}", document.path.display()))?
{
collector.ingest(link);
@@ -497,7 +492,7 @@ fn extract_markdown_paragraphs(
fn match_all_paragraphs(base_path: PathBuf, sources_path: PathBuf) -> Result<(), Error> {
println!("Reading files");
let html_result =
- extract_html_links::, ParagraphHasher>(&base_path, true, true)?;
+ extract_html_links::, ParagraphHasher>(&base_path, true)?;
println!("Reading source files");
let paragraps_to_sourcefile = extract_markdown_paragraphs::(&sources_path)?;
diff --git a/src/paragraph.rs b/src/paragraph.rs
index 81a8aa4..fef7f04 100644
--- a/src/paragraph.rs
+++ b/src/paragraph.rs
@@ -15,6 +15,12 @@ pub trait ParagraphWalker: Send {
type Paragraph: Clone + Eq + PartialEq + Hash + Ord + PartialOrd + Send + 'static;
fn new() -> Self;
+
+ #[inline]
+ fn is_noop() -> bool {
+ false
+ }
+
fn update_raw(&mut self, text: &[u8]);
fn finish_paragraph(&mut self) -> Option;
@@ -101,12 +107,20 @@ pub enum VoidParagraph {}
impl ParagraphWalker for NoopParagraphWalker {
type Paragraph = VoidParagraph;
+ #[inline]
fn new() -> Self {
NoopParagraphWalker
}
+ #[inline]
+ fn is_noop() -> bool {
+ true
+ }
+
+ #[inline]
fn update_raw(&mut self, _text: &[u8]) {}
+ #[inline]
fn finish_paragraph(&mut self) -> Option {
None
}