mirror of
https://github.com/egor-white/zaprett.git
synced 2025-12-11 13:59:43 +05:00
unnecessary .unwrap
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
pub mod commands;
|
pub mod commands;
|
||||||
|
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
use getset::Getters;
|
|
||||||
use commands::Command;
|
use commands::Command;
|
||||||
|
use getset::Getters;
|
||||||
|
|
||||||
#[derive(Parser, Getters)]
|
#[derive(Parser, Getters)]
|
||||||
#[command(version)]
|
#[command(version)]
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ pub async fn start_service() -> anyhow::Result<()> {
|
|||||||
bail!("Running not from root, exiting");
|
bail!("Running not from root, exiting");
|
||||||
};
|
};
|
||||||
|
|
||||||
if service_status().await.unwrap() {
|
if service_status().await? {
|
||||||
bail!("zaprett already started")
|
bail!("zaprett already started")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -77,8 +77,8 @@ pub async fn stop_service() -> anyhow::Result<()> {
|
|||||||
bail!("Running not from root, exiting");
|
bail!("Running not from root, exiting");
|
||||||
};
|
};
|
||||||
|
|
||||||
if !service_status().await.unwrap() {
|
if !service_status().await? {
|
||||||
bail!("zaprett service alreeady stopped")
|
bail!("zaprett service already stopped")
|
||||||
}
|
}
|
||||||
|
|
||||||
clear_iptables_rules().expect("clear iptables rules");
|
clear_iptables_rules().expect("clear iptables rules");
|
||||||
|
|||||||
Reference in New Issue
Block a user