mirror of
https://gitlab.steamos.cloud/holo/steamos-manager.git
synced 2025-07-10 00:20:29 -04:00
systemd: Fix some clippy warnings
This commit is contained in:
parent
c82e8df52c
commit
94e4c69456
1 changed files with 5 additions and 4 deletions
|
@ -32,6 +32,7 @@ trait SystemdUnit {
|
||||||
default_path = "/org/freedesktop/systemd1"
|
default_path = "/org/freedesktop/systemd1"
|
||||||
)]
|
)]
|
||||||
trait SystemdManager {
|
trait SystemdManager {
|
||||||
|
#[allow(clippy::type_complexity)]
|
||||||
async fn enable_unit_files(
|
async fn enable_unit_files(
|
||||||
&self,
|
&self,
|
||||||
files: &[&str],
|
files: &[&str],
|
||||||
|
@ -114,7 +115,7 @@ impl<'dbus> SystemdUnit<'dbus> {
|
||||||
let (_, res) = manager
|
let (_, res) = manager
|
||||||
.enable_unit_files(&[self.name.as_str()], false, false)
|
.enable_unit_files(&[self.name.as_str()], false, false)
|
||||||
.await?;
|
.await?;
|
||||||
Ok(res.len() > 0)
|
Ok(!res.is_empty())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn disable(&self) -> Result<bool> {
|
pub async fn disable(&self) -> Result<bool> {
|
||||||
|
@ -122,7 +123,7 @@ impl<'dbus> SystemdUnit<'dbus> {
|
||||||
let res = manager
|
let res = manager
|
||||||
.disable_unit_files(&[self.name.as_str()], false)
|
.disable_unit_files(&[self.name.as_str()], false)
|
||||||
.await?;
|
.await?;
|
||||||
Ok(res.len() > 0)
|
Ok(!res.is_empty())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn mask(&self) -> Result<bool> {
|
pub async fn mask(&self) -> Result<bool> {
|
||||||
|
@ -130,7 +131,7 @@ impl<'dbus> SystemdUnit<'dbus> {
|
||||||
let res = manager
|
let res = manager
|
||||||
.mask_unit_files(&[self.name.as_str()], false)
|
.mask_unit_files(&[self.name.as_str()], false)
|
||||||
.await?;
|
.await?;
|
||||||
Ok(res.len() > 0)
|
Ok(!res.is_empty())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn unmask(&self) -> Result<bool> {
|
pub async fn unmask(&self) -> Result<bool> {
|
||||||
|
@ -138,7 +139,7 @@ impl<'dbus> SystemdUnit<'dbus> {
|
||||||
let res = manager
|
let res = manager
|
||||||
.unmask_unit_files(&[self.name.as_str()], false)
|
.unmask_unit_files(&[self.name.as_str()], false)
|
||||||
.await?;
|
.await?;
|
||||||
Ok(res.len() > 0)
|
Ok(!res.is_empty())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn active(&self) -> Result<bool> {
|
pub async fn active(&self) -> Result<bool> {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue