ksud: make clippy happy

This commit is contained in:
weishu
2025-02-05 16:15:10 +08:00
parent 29a27c37d1
commit 3d3bc5ce3c
2 changed files with 2 additions and 2 deletions

View File

@@ -74,7 +74,7 @@ fn parse_kmi_from_modules() -> Result<String> {
// find a *.ko in /vendor/lib/modules // find a *.ko in /vendor/lib/modules
let modfile = std::fs::read_dir("/vendor/lib/modules")? let modfile = std::fs::read_dir("/vendor/lib/modules")?
.filter_map(Result::ok) .filter_map(Result::ok)
.find(|entry| entry.path().extension().map_or(false, |ext| ext == "ko")) .find(|entry| entry.path().extension().is_some_and(|ext| ext == "ko"))
.map(|entry| entry.path()) .map(|entry| entry.path())
.ok_or_else(|| anyhow!("No kernel module found"))?; .ok_or_else(|| anyhow!("No kernel module found"))?;
let output = Command::new("modinfo").arg(modfile).output()?; let output = Command::new("modinfo").arg(modfile).output()?;

View File

@@ -167,7 +167,7 @@ enum PolicyStatement<'a> {
} }
impl<'a> SeObjectParser<'a> for NormalPerm<'a> { impl<'a> SeObjectParser<'a> for NormalPerm<'a> {
fn parse(input: &'a str) -> IResult<&str, Self> { fn parse(input: &'a str) -> IResult<&'a str, Self> {
let (input, op) = alt(( let (input, op) = alt((
tag("allow"), tag("allow"),
tag("deny"), tag("deny"),