Skip to content

Commit

Permalink
refactor: fix lifetime warnings introduced in 1.83.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hoodie committed Nov 30, 2024
1 parent 0c901ad commit 5c16023
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/parser/components.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ pub fn read_component(input: &str) -> Result<Component<'_>, String> {

pub fn component<'a, E: ParseError<&'a str> + ContextError<&'a str>>(
input: &'a str,
) -> IResult<&'a str, Component, E> {
) -> IResult<&'a str, Component<'a>, E> {
let (input, name) = line("BEGIN:", valid_key_sequence_cow)(input)?;

let (input, (properties, components)) = many_till(
Expand Down Expand Up @@ -512,6 +512,6 @@ fn test_faulty_component() {

pub fn components<'a, E: ParseError<&'a str> + ContextError<&'a str>>(
input: &'a str,
) -> IResult<&'a str, Vec<Component>, E> {
) -> IResult<&'a str, Vec<Component<'a>>, E> {
complete(many0(all_consuming(component)))(input)
}
2 changes: 1 addition & 1 deletion src/parser/parameters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,6 @@ pub fn parse_parameter_list() {

pub fn parameters<'a, E: ParseError<&'a str> + ContextError<&'a str>>(
input: &'a str,
) -> IResult<&'a str, Vec<Parameter>, E> {
) -> IResult<&'a str, Vec<Parameter<'a>>, E> {
many0(parameter)(input)
}
2 changes: 1 addition & 1 deletion src/parser/properties.rs
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ fn determin_value_type(name: &ParseString, params: &[Parameter]) -> Option<Value

pub fn property<'a, E: ParseError<&'a str> + ContextError<&'a str>>(
input: &'a str,
) -> IResult<&'a str, Property, E> {
) -> IResult<&'a str, Property<'a>, E> {
context(
"property",
cut(tuple((
Expand Down
4 changes: 2 additions & 2 deletions src/parser/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use super::parsed_string::ParseString;
// TODO: how do I express <<alpha_or_dash, but not "END">>
pub fn property_key<'a, E: ParseError<&'a str> + ContextError<&'a str>>(
input: &'a str,
) -> IResult<&'a str, &str, E> {
) -> IResult<&'a str, &'a str, E> {
if input.get(0..=2) == Some("END") || input.get(0..=4) == Some("BEGIN") {
IResult::Err(Err::Error(nom::error::make_error(
input,
Expand All @@ -28,7 +28,7 @@ pub fn property_key<'a, E: ParseError<&'a str> + ContextError<&'a str>>(

pub fn valid_key_sequence<'a, E: ParseError<&'a str> + ContextError<&'a str>>(
input: &'a str,
) -> IResult<&'a str, &str, E> {
) -> IResult<&'a str, &'a str, E> {
take_while(|c: char| {
c == '.' || c == ',' || c == '/' || c == '_' || c == '-' || c.is_alphanumeric()
})
Expand Down

0 comments on commit 5c16023

Please sign in to comment.