Get rid of some warnings

This commit is contained in:
Elias Schriefer 2020-11-03 17:49:06 +01:00
parent 52d34e42a1
commit 2f8ae9a3f8

View File

@ -38,14 +38,14 @@ impl<'proxy> NativeObject<'proxy> {
}
}
fn no_path<MD: core::fmt::Display, VD: core::fmt::Debug>(method: MD, variant: VD) -> ! {
panic!("No method {} on variant {:?}", method, variant)
}
// fn no_path<MD: core::fmt::Display, VD: core::fmt::Debug>(method: MD, variant: VD) -> ! {
// panic!("No method {} on variant {:?}", method, variant)
// }
pub async fn start(&self) -> Result<(), Error> {
let proxy = match self {
Self::Daemon(p) | Self::Minecraft(p) => p,
_ => Self::no_path("start", self)
// _ => Self::no_path("start", self)
};
proxy.method_call(iface_name("Service"), "Start", ()).await
@ -54,7 +54,7 @@ impl<'proxy> NativeObject<'proxy> {
pub async fn stop(&self) -> Result<(), Error> {
let proxy = match self {
Self::Daemon(p) | Self::Minecraft(p) => p,
_ => Self::no_path("stop", self)
// _ => Self::no_path("stop", self)
};
let res = proxy.method_call(iface_name("Service"), "Stop", ()).await;
@ -74,7 +74,7 @@ impl<'proxy> NativeObject<'proxy> {
pub async fn is_running(&self) -> bool {
let proxy = match self {
Self::Daemon(p) | Self::Minecraft(p) => p,
_ => Self::no_path("is_running", self)
// _ => Self::no_path("is_running", self)
};
let res = proxy.method_call(iface_name("Service"), "IsRunning", ()).await;
@ -93,7 +93,7 @@ impl<'proxy> NativeObject<'proxy> {
pub async fn restart(&self) -> Result<(), Error> {
let proxy = match self {
Self::Daemon(p) | Self::Minecraft(p) => p,
_ => Self::no_path("restart", self)
// _ => Self::no_path("restart", self)
};
proxy.method_call(iface_name("Service"), "Restart", ()).await