Skip to content

Commit

Permalink
Rollup merge of rust-lang#105684 - GuillaumeGomez:improve-rustdoc-var…
Browse files Browse the repository at this point in the history
…-name, r=notriddle

Improve rustdoc markdown variable naming

Opened on the right repository this time. 😆

r? `@notriddle`
  • Loading branch information
matthiaskrgr committed Dec 14, 2022
2 parents e2c9823 + 19e7dbd commit 37bf2bc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/librustdoc/html/markdown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,12 +236,12 @@ impl<'a, I: Iterator<Item = Event<'a>>> Iterator for CodeBlocks<'_, 'a, I> {
return event;
};

let mut origtext = String::new();
let mut original_text = String::new();
for event in &mut self.inner {
match event {
Event::End(Tag::CodeBlock(..)) => break,
Event::Text(ref s) => {
origtext.push_str(s);
original_text.push_str(s);
}
_ => {}
}
Expand All @@ -258,7 +258,7 @@ impl<'a, I: Iterator<Item = Event<'a>>> Iterator for CodeBlocks<'_, 'a, I> {
<pre class=\"language-{}\"><code>{}</code></pre>\
</div>",
lang,
Escape(&origtext),
Escape(&original_text),
)
.into(),
));
Expand All @@ -268,7 +268,7 @@ impl<'a, I: Iterator<Item = Event<'a>>> Iterator for CodeBlocks<'_, 'a, I> {
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>();

compile_fail = parse_result.compile_fail;
Expand All @@ -285,7 +285,7 @@ impl<'a, I: Iterator<Item = Event<'a>>> Iterator for CodeBlocks<'_, 'a, I> {
if url.is_empty() {
return None;
}
let test = origtext
let test = original_text
.lines()
.map(|l| map_line(l).for_code())
.intersperse("\n".into())
Expand Down

0 comments on commit 37bf2bc

Please sign in to comment.