Convert all functions to using the wrapped input type.
This commit is contained in:
@@ -9,6 +9,7 @@ use nom::combinator::eof;
|
||||
use nom::multi::separated_list1;
|
||||
use nom::sequence::tuple;
|
||||
|
||||
use super::org_source::OrgSource;
|
||||
use super::Context;
|
||||
use crate::error::Res;
|
||||
use crate::parser::lesser_element::Planning;
|
||||
@@ -16,7 +17,10 @@ use crate::parser::util::get_consumed;
|
||||
use crate::parser::util::start_of_line;
|
||||
|
||||
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
|
||||
pub fn planning<'r, 's>(context: Context<'r, 's>, input: &'s str) -> Res<&'s str, Planning<'s>> {
|
||||
pub fn planning<'r, 's>(
|
||||
context: Context<'r, 's>,
|
||||
input: OrgSource<'s>,
|
||||
) -> Res<OrgSource<'s>, Planning<'s>> {
|
||||
start_of_line(context, input)?;
|
||||
let (remaining, _leading_whitespace) = space0(input)?;
|
||||
let (remaining, _planning_parameters) = separated_list1(space1, planning_parameter)(remaining)?;
|
||||
@@ -24,11 +28,16 @@ pub fn planning<'r, 's>(context: Context<'r, 's>, input: &'s str) -> Res<&'s str
|
||||
|
||||
let source = get_consumed(input, remaining);
|
||||
|
||||
Ok((remaining, Planning { source }))
|
||||
Ok((
|
||||
remaining,
|
||||
Planning {
|
||||
source: source.into(),
|
||||
},
|
||||
))
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
|
||||
fn planning_parameter<'s>(input: &'s str) -> Res<&'s str, &'s str> {
|
||||
fn planning_parameter<'s>(input: OrgSource<'s>) -> Res<OrgSource<'s>, OrgSource<'s>> {
|
||||
let (remaining, _planning_type) = alt((
|
||||
tag_no_case("DEADLINE"),
|
||||
tag_no_case("SCHEDULED"),
|
||||
|
||||
Reference in New Issue
Block a user