aboutsummaryrefslogtreecommitdiffstats
path: root/src/to_mdast.rs
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-10-14 10:11:59 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-10-14 10:11:59 +0200
commitefd20b4999d51fed3ff641f922da05e8bb2481a0 (patch)
treeb6ed7ba04d1f020e119364821badff056b17a058 /src/to_mdast.rs
parent95f66dc8b4a8cb4c40aa6e4b231bafde516a68bc (diff)
downloadmarkdown-rs-efd20b4999d51fed3ff641f922da05e8bb2481a0.tar.gz
markdown-rs-efd20b4999d51fed3ff641f922da05e8bb2481a0.tar.bz2
markdown-rs-efd20b4999d51fed3ff641f922da05e8bb2481a0.zip
Remove some unused code around slices
Diffstat (limited to 'src/to_mdast.rs')
-rw-r--r--src/to_mdast.rs9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/to_mdast.rs b/src/to_mdast.rs
index 1d25beb..1ce5826 100644
--- a/src/to_mdast.rs
+++ b/src/to_mdast.rs
@@ -1278,12 +1278,9 @@ fn on_exit_heading_setext_text(context: &mut CompileContext) {
/// Handle [`Exit`][Kind::Exit]:[`HeadingSetextUnderlineSequence`][Name::HeadingSetextUnderlineSequence].
fn on_exit_heading_setext_underline_sequence(context: &mut CompileContext) {
- let head = Slice::from_position(
- context.bytes,
- &SlicePosition::from_exit_event(context.events, context.index),
- )
- .head();
- let depth = if head == Some(b'-') { 2 } else { 1 };
+ let position = SlicePosition::from_exit_event(context.events, context.index);
+ let head = context.bytes[position.start.index];
+ let depth = if head == b'-' { 2 } else { 1 };
if let Node::Heading(node) = context.tail_mut() {
node.depth = depth;