Improve rustdoc markdown variable naming

This commit is contained in:
Guillaume Gomez 2022-12-13 10:20:37 +01:00 committed by GitHub
parent 71ec1457ee
commit 19e7dbd288
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -236,12 +236,12 @@ impl<'a, I: Iterator<Item = Event<'a>>> Iterator for CodeBlocks<'_, 'a, I> {
return event; return event;
}; };
let mut origtext = String::new(); let mut original_text = String::new();
for event in &mut self.inner { for event in &mut self.inner {
match event { match event {
Event::End(Tag::CodeBlock(..)) => break, Event::End(Tag::CodeBlock(..)) => break,
Event::Text(ref s) => { Event::Text(ref s) => {
origtext.push_str(s); original_text.push_str(s);
} }
_ => {} _ => {}
} }
@ -258,7 +258,7 @@ impl<'a, I: Iterator<Item = Event<'a>>> Iterator for CodeBlocks<'_, 'a, I> {
<pre class=\"language-{}\"><code>{}</code></pre>\ <pre class=\"language-{}\"><code>{}</code></pre>\
</div>", </div>",
lang, lang,
Escape(&origtext), Escape(&original_text),
) )
.into(), .into(),
)); ));
@ -268,7 +268,7 @@ impl<'a, I: Iterator<Item = Event<'a>>> Iterator for CodeBlocks<'_, 'a, I> {
CodeBlockKind::Indented => Default::default(), CodeBlockKind::Indented => Default::default(),
}; };
let lines = origtext.lines().filter_map(|l| map_line(l).for_html()); let lines = original_text.lines().filter_map(|l| map_line(l).for_html());
let text = lines.intersperse("\n".into()).collect::<String>(); let text = lines.intersperse("\n".into()).collect::<String>();
compile_fail = parse_result.compile_fail; compile_fail = parse_result.compile_fail;
@ -285,7 +285,7 @@ impl<'a, I: Iterator<Item = Event<'a>>> Iterator for CodeBlocks<'_, 'a, I> {
if url.is_empty() { if url.is_empty() {
return None; return None;
} }
let test = origtext let test = original_text
.lines() .lines()
.map(|l| map_line(l).for_code()) .map(|l| map_line(l).for_code())
.intersperse("\n".into()) .intersperse("\n".into())