From fd036263623c30dc7eec6fc94f63760cc80b1934 Mon Sep 17 00:00:00 2001 From: weishu Date: Sat, 21 Oct 2023 13:21:33 +0800 Subject: [PATCH] ksud: make cargo fmt happy --- userspace/ksud/src/apk_sign.rs | 5 +---- userspace/ksud/src/cli.rs | 4 +--- userspace/ksud/src/profile.rs | 2 +- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/userspace/ksud/src/apk_sign.rs b/userspace/ksud/src/apk_sign.rs index 9e8dad3f..6d047cca 100644 --- a/userspace/ksud/src/apk_sign.rs +++ b/userspace/ksud/src/apk_sign.rs @@ -81,13 +81,10 @@ pub fn get_apk_signature(apk: &str) -> Result<(u32, String)> { } if v3_signing_exist || v3_1_signing_exist { - return Err(anyhow::anyhow!( - "Unexpected v3 signature found!", - )); + return Err(anyhow::anyhow!("Unexpected v3 signature found!",)); } v2_signing.ok_or(anyhow::anyhow!("No signature found!")) - } fn calc_cert_sha256( diff --git a/userspace/ksud/src/cli.rs b/userspace/ksud/src/cli.rs index cf414912..9c8f156c 100644 --- a/userspace/ksud/src/cli.rs +++ b/userspace/ksud/src/cli.rs @@ -224,9 +224,7 @@ pub fn run() -> Result<()> { crate::profile::set_sepolicy(package, policy) } Profile::GetTemplate { id } => crate::profile::get_template(id), - Profile::SetTemplate { id, template } => { - crate::profile::set_template(id, template) - }, + Profile::SetTemplate { id, template } => crate::profile::set_template(id, template), Profile::DeleteTemplate { id } => crate::profile::delete_template(id), Profile::ListTemplates => crate::profile::list_templates(), }, diff --git a/userspace/ksud/src/profile.rs b/userspace/ksud/src/profile.rs index 21ecd5cf..21574448 100644 --- a/userspace/ksud/src/profile.rs +++ b/userspace/ksud/src/profile.rs @@ -42,7 +42,7 @@ pub fn delete_template(id: String) -> Result<()> { pub fn list_templates() -> Result<()> { let templates = std::fs::read_dir(defs::PROFILE_TEMPLATE_DIR); let Ok(templates) = templates else { - return Ok(()) + return Ok(()); }; for template in templates { let template = template?;