Remove unnecessary peak.

This commit is contained in:
Tom Alexander 2023-09-21 16:34:24 -04:00
parent 124cd50243
commit 5716cbccea
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
2 changed files with 6 additions and 1 deletions

View File

@ -6,3 +6,6 @@ https://en.wikipedia.org/wiki/Shebang_(Unix
# Parenthesis only allowed to depth of 2 so link ends at underscore.
https://en.wikipedia.org/wiki/Shebang_(((Unix)))
# Even though they eventually become balanced, we hit negative parenthesis depth so link ends at )
https://en.wikipedia.org/wiki/Shebang)Unix(

View File

@ -10,10 +10,12 @@ use nom::combinator::recognize;
use nom::combinator::verify;
use nom::multi::many_till;
use super::org_source::BracketDepth;
use super::org_source::OrgSource;
use super::util::maybe_consume_object_trailing_whitespace_if_not_exiting;
use crate::context::parser_with_context;
use crate::context::ContextElement;
use crate::context::ContextMatcher;
use crate::context::ExitClass;
use crate::context::ExitMatcherNode;
use crate::context::RefContext;
@ -140,7 +142,7 @@ fn path_plain<'b, 'g, 'r, 's>(
let exit_matcher = parser_with_context!(exit_matcher_parser)(&parser_context);
let (remaining, path) = recognize(verify(
many_till(anychar, peek(exit_matcher)),
many_till(anychar, exit_matcher),
|(children, _exit_contents)| !children.is_empty(),
))(input)?;