Skip to content

Commit c5f78b3

Browse files
authored
Merge pull request #599 from kivikakk/push-tukmuowvvxns
rename a bunch of "nch" to "nh".
2 parents 21a8023 + ffa8aff commit c5f78b3

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/cm.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ impl<'a, 'o, 'c> CommonMarkFormatter<'a, 'o, 'c> {
357357
NodeValue::DescriptionItem(..) => (),
358358
NodeValue::DescriptionTerm => (),
359359
NodeValue::DescriptionDetails => self.format_description_details(entering),
360-
NodeValue::Heading(ref nch) => self.format_heading(nch, entering),
360+
NodeValue::Heading(ref nh) => self.format_heading(nh, entering),
361361
NodeValue::CodeBlock(ref ncb) => self.format_code_block(node, ncb, entering),
362362
NodeValue::HtmlBlock(ref nhb) => self.format_html_block(nhb, entering),
363363
NodeValue::ThematicBreak => self.format_thematic_break(entering),
@@ -538,9 +538,9 @@ impl<'a, 'o, 'c> CommonMarkFormatter<'a, 'o, 'c> {
538538
}
539539
}
540540

541-
fn format_heading(&mut self, nch: &NodeHeading, entering: bool) {
541+
fn format_heading(&mut self, nh: &NodeHeading, entering: bool) {
542542
if entering {
543-
for _ in 0..nch.level {
543+
for _ in 0..nh.level {
544544
write!(self, "#").unwrap();
545545
}
546546
write!(self, " ").unwrap();

src/html.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -619,15 +619,15 @@ fn render_heading<'a, T>(
619619
node: &'a AstNode<'a>,
620620
entering: bool,
621621
) -> io::Result<ChildRendering> {
622-
let NodeValue::Heading(ref nch) = node.data.borrow().value else {
622+
let NodeValue::Heading(ref nh) = node.data.borrow().value else {
623623
unreachable!()
624624
};
625625

626626
match context.plugins.render.heading_adapter {
627627
None => {
628628
if entering {
629629
context.cr()?;
630-
write!(context, "<h{}", nch.level)?;
630+
write!(context, "<h{}", nh.level)?;
631631
render_sourcepos(context, node)?;
632632
context.write_all(b">")?;
633633

@@ -644,15 +644,15 @@ fn render_heading<'a, T>(
644644
)?;
645645
}
646646
} else {
647-
writeln!(context, "</h{}>", nch.level)?;
647+
writeln!(context, "</h{}>", nh.level)?;
648648
}
649649
}
650650
Some(adapter) => {
651651
let mut text_content = Vec::with_capacity(20);
652652
collect_text(node, &mut text_content);
653653
let content = String::from_utf8(text_content).unwrap();
654654
let heading = HeadingMeta {
655-
level: nch.level,
655+
level: nh.level,
656656
content,
657657
};
658658

src/xml.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,8 @@ impl<'o, 'c> XmlFormatter<'o, 'c> {
183183
NodeValue::DescriptionItem(..) => (),
184184
NodeValue::DescriptionTerm => {}
185185
NodeValue::DescriptionDetails => {}
186-
NodeValue::Heading(ref nch) => {
187-
write!(self.output, " level=\"{}\"", nch.level)?;
186+
NodeValue::Heading(ref nh) => {
187+
write!(self.output, " level=\"{}\"", nh.level)?;
188188
}
189189
NodeValue::CodeBlock(ref ncb) => {
190190
if !ncb.info.is_empty() {

0 commit comments

Comments
 (0)