mirror of
https://github.com/egor-white/zaprett.git
synced 2025-12-10 05:19:42 +05:00
unnecessary .unwrap
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
pub mod commands;
|
||||
|
||||
use clap::Parser;
|
||||
use getset::Getters;
|
||||
use commands::Command;
|
||||
use getset::Getters;
|
||||
|
||||
#[derive(Parser, Getters)]
|
||||
#[command(version)]
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user