Convert all functions to using the wrapped input type.
This commit is contained in:
@@ -19,6 +19,7 @@ use super::lesser_block::example_block;
|
||||
use super::lesser_block::export_block;
|
||||
use super::lesser_block::src_block;
|
||||
use super::lesser_block::verse_block;
|
||||
use super::org_source::OrgSource;
|
||||
use super::paragraph::paragraph;
|
||||
use super::plain_list::plain_list;
|
||||
use super::source::SetSource;
|
||||
@@ -31,16 +32,16 @@ use crate::parser::table::org_mode_table;
|
||||
|
||||
pub fn element(
|
||||
can_be_paragraph: bool,
|
||||
) -> impl for<'r, 's> Fn(Context<'r, 's>, &'s str) -> Res<&'s str, Element<'s>> {
|
||||
move |context: Context, input: &str| _element(context, input, can_be_paragraph)
|
||||
) -> impl for<'r, 's> Fn(Context<'r, 's>, OrgSource<'s>) -> Res<OrgSource<'s>, Element<'s>> {
|
||||
move |context: Context, input: OrgSource<'_>| _element(context, input, can_be_paragraph)
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
|
||||
fn _element<'r, 's>(
|
||||
context: Context<'r, 's>,
|
||||
input: &'s str,
|
||||
input: OrgSource<'s>,
|
||||
can_be_paragraph: bool,
|
||||
) -> Res<&'s str, Element<'s>> {
|
||||
) -> Res<OrgSource<'s>, Element<'s>> {
|
||||
let plain_list_matcher = parser_with_context!(plain_list)(context);
|
||||
let greater_block_matcher = parser_with_context!(greater_block)(context);
|
||||
let dynamic_block_matcher = parser_with_context!(dynamic_block)(context);
|
||||
@@ -103,7 +104,7 @@ fn _element<'r, 's>(
|
||||
maybe_consume_trailing_whitespace_if_not_exiting(context, remaining)?;
|
||||
|
||||
let source = get_consumed(input, remaining);
|
||||
element.set_source(source);
|
||||
element.set_source(source.into());
|
||||
|
||||
Ok((remaining, element))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user