unnecessary .unwrap

This commit is contained in:
sqlerrorthing
2025-11-03 05:02:51 +08:00
parent 91d08d3df4
commit 16ba9bedfc
2 changed files with 4 additions and 4 deletions

View File

@@ -1,8 +1,8 @@
pub mod commands;
use clap::Parser;
use getset::Getters;
use commands::Command;
use getset::Getters;
#[derive(Parser, Getters)]
#[command(version)]

View File

@@ -20,7 +20,7 @@ pub async fn start_service() -> anyhow::Result<()> {
bail!("Running not from root, exiting");
};
if service_status().await.unwrap() {
if service_status().await? {
bail!("zaprett already started")
}
@@ -77,8 +77,8 @@ pub async fn stop_service() -> anyhow::Result<()> {
bail!("Running not from root, exiting");
};
if !service_status().await.unwrap() {
bail!("zaprett service alreeady stopped")
if !service_status().await? {
bail!("zaprett service already stopped")
}
clear_iptables_rules().expect("clear iptables rules");