Skip to content

Commit

Permalink
Update ref parser to match on unit pattern where applicable
Browse files Browse the repository at this point in the history
These were highlighted by clippy after updating to Rust 1.73.0.
  • Loading branch information
simu committed Oct 13, 2023
1 parent fa50189 commit 77085ea
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/refs/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ fn ref_content(input: &str) -> IResult<&str, String, VerboseError<&str>> {
"ref_not_close",
tuple((not(tag("}")), not(tag("\\}")), not(tag("\\\\}")))),
),
|(_, _, _)| (),
|((), (), ())| (),
)(input)
}

Expand All @@ -113,9 +113,10 @@ fn ref_content(input: &str) -> IResult<&str, String, VerboseError<&str>> {
"ref_text",
alt((
map(many1(none_of("\\${}")), |ch| ch.iter().collect::<String>()),
map(tuple((not(tag("}")), take(1usize))), |(_, c): (_, &str)| {
c.to_string()
}),
map(
tuple((not(tag("}")), take(1usize))),
|((), c): ((), &str)| c.to_string(),
),
)),
)(input)
}
Expand All @@ -125,7 +126,7 @@ fn ref_content(input: &str) -> IResult<&str, String, VerboseError<&str>> {
"ref_content",
tuple((ref_not_open, ref_not_close, ref_text)),
),
|(_, _, t)| t,
|((), (), t)| t,
)(input)
}

Expand Down

0 comments on commit 77085ea

Please sign in to comment.