From e5224cda632a493d9b3c0be4d3c9684e3478dff9 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Thu, 24 Aug 2023 18:39:55 -0400 Subject: [PATCH] Removing dead code. --- src/parser/footnote_reference.rs | 6 ------ src/parser/lesser_block.rs | 2 +- src/parser/util.rs | 21 --------------------- 3 files changed, 1 insertion(+), 28 deletions(-) diff --git a/src/parser/footnote_reference.rs b/src/parser/footnote_reference.rs index 10956a8d..74849b71 100644 --- a/src/parser/footnote_reference.rs +++ b/src/parser/footnote_reference.rs @@ -20,7 +20,6 @@ use crate::parser::parser_with_context::parser_with_context; use crate::parser::util::exit_matcher_parser; use crate::parser::util::get_consumed; use crate::parser::FootnoteReference; -use crate::parser::Object; #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn footnote_reference<'r, 's>( @@ -134,11 +133,6 @@ fn footnote_reference_only<'r, 's>( )) } -#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] -fn definition<'s>(input: OrgSource<'s>) -> Res, Vec>> { - Ok((input, vec![])) -} - #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn footnote_definition_end<'r, 's>( context: Context<'r, 's>, diff --git a/src/parser/lesser_block.rs b/src/parser/lesser_block.rs index 7a60c6c5..8725defd 100644 --- a/src/parser/lesser_block.rs +++ b/src/parser/lesser_block.rs @@ -124,7 +124,7 @@ pub fn example_block<'r, 's>( context: Context<'r, 's>, input: OrgSource<'s>, ) -> Res, ExampleBlock<'s>> { - let (remaining, name) = lesser_block_begin("example")(context, input)?; + let (remaining, _name) = lesser_block_begin("example")(context, input)?; let (remaining, parameters) = opt(tuple((space1, data)))(remaining)?; let (remaining, _nl) = line_ending(remaining)?; let lesser_block_end_specialized = lesser_block_end("example"); diff --git a/src/parser/util.rs b/src/parser/util.rs index f70685a0..7340abbd 100644 --- a/src/parser/util.rs +++ b/src/parser/util.rs @@ -1,7 +1,6 @@ use nom::branch::alt; use nom::character::complete::anychar; use nom::character::complete::line_ending; -use nom::character::complete::multispace0; use nom::character::complete::none_of; use nom::character::complete::space0; use nom::combinator::eof; @@ -101,11 +100,6 @@ pub fn maybe_consume_trailing_whitespace<'r, 's>( } } -#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] -pub fn trailing_whitespace(input: OrgSource<'_>) -> Res, OrgSource<'_>> { - alt((eof, recognize(tuple((line_ending, many0(blank_line))))))(input) -} - /// Check that we are at the start of a line #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn start_of_line<'r, 's>( @@ -157,21 +151,6 @@ pub fn exit_matcher_parser<'r, 's>( peek(|i| context.check_exit_matcher(i))(input) } -#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] -pub fn always_fail<'r, 's>( - _context: Context<'r, 's>, - input: OrgSource<'s>, -) -> Res, OrgSource<'s>> { - Err(nom::Err::Error(CustomError::MyError(MyError( - "Always fail".into(), - )))) -} - -#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] -pub fn whitespace_eof(input: OrgSource<'_>) -> Res, OrgSource<'_>> { - recognize(tuple((multispace0, eof)))(input) -} - #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub fn text_until_exit<'r, 's>( context: Context<'r, 's>,