ksud: fix some warnings

warning: hiding a lifetime that's elided elsewhere is confusing
  --> src/sepolicy.rs:22:30
   |
22 | fn parse_bracket_objs(input: &str) -> IResult<&str, SeObject> {
   |                              ^^^^             ----  -------- the same lifetime is hidden here
   |                              |                |
   |                              |                the same lifetime is elided here
   |                              the lifetime is elided here

Signed-off-by: rsuntk <rsuntk@yukiprjkt.my.id>
This commit is contained in:
rsuntk
2025-08-24 17:25:28 +07:00
committed by ShirkNeko
parent ea602be270
commit 436071a3f1

View File

@@ -19,7 +19,7 @@ fn parse_single_word(input: &str) -> IResult<&str, &str> {
take_while1(is_sepolicy_char).parse(input)
}
fn parse_bracket_objs(input: &str) -> IResult<&str, SeObject> {
fn parse_bracket_objs<'a>(input: &'a str) -> IResult<&'a str, SeObject<'a>> {
let (input, (_, words, _)) = (
tag("{"),
take_while_m_n(1, 100, |c: char| is_sepolicy_char(c) || c.is_whitespace()),
@@ -29,12 +29,12 @@ fn parse_bracket_objs(input: &str) -> IResult<&str, SeObject> {
Ok((input, words.split_whitespace().collect()))
}
fn parse_single_obj(input: &str) -> IResult<&str, SeObject> {
fn parse_single_obj<'a>(input: &'a str) -> IResult<&'a str, SeObject<'a>> {
let (input, word) = take_while1(is_sepolicy_char).parse(input)?;
Ok((input, vec![word]))
}
fn parse_star(input: &str) -> IResult<&str, SeObject> {
fn parse_star<'a>(input: &'a str) -> IResult<&'a str, SeObject<'a>> {
let (input, _) = tag("*").parse(input)?;
Ok((input, vec!["*"]))
}
@@ -42,12 +42,12 @@ fn parse_star(input: &str) -> IResult<&str, SeObject> {
// 1. a single sepolicy word
// 2. { obj1 obj2 obj3 ...}
// 3. *
fn parse_seobj(input: &str) -> IResult<&str, SeObject> {
fn parse_seobj<'a>(input: &'a str) -> IResult<&'a str, SeObject<'a>> {
let (input, strs) = alt((parse_single_obj, parse_bracket_objs, parse_star)).parse(input)?;
Ok((input, strs))
}
fn parse_seobj_no_star(input: &str) -> IResult<&str, SeObject> {
fn parse_seobj_no_star<'a>(input: &'a str) -> IResult<&'a str, SeObject<'a>> {
let (input, strs) = alt((parse_single_obj, parse_bracket_objs)).parse(input)?;
Ok((input, strs))
}