From c756be5f025cb6c7c8c920771c00495ff485270b Mon Sep 17 00:00:00 2001 From: Zeeshan Ali Khan Date: Tue, 30 Jan 2024 13:54:37 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A8=20Explicit=20lifetimes=20for=20con?= =?UTF-8?q?stant=20string=20literals?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ``` warning: `&` without an explicit lifetime name cannot be used here --> src/fdo/dbus.rs:29:21 | 29 | pub const PATH: &str = "/org/freedesktop/DBus"; | ^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #115010 = note: `#[warn(elided_lifetimes_in_associated_constant)]` on by default help: use the `'static` lifetime | 29 | pub const PATH: &'static str = "/org/freedesktop/DBus"; | +++++++ ``` --- src/fdo/dbus.rs | 4 ++-- src/fdo/monitoring.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/fdo/dbus.rs b/src/fdo/dbus.rs index 9531bc1..4e4cfc4 100644 --- a/src/fdo/dbus.rs +++ b/src/fdo/dbus.rs @@ -26,8 +26,8 @@ pub struct DBus { } impl DBus { - pub const PATH: &str = "/org/freedesktop/DBus"; - pub const INTERFACE: &str = "org.freedesktop.DBus"; + pub const PATH: &'static str = "/org/freedesktop/DBus"; + pub const INTERFACE: &'static str = "org.freedesktop.DBus"; pub fn new(peers: Arc, guid: Arc) -> Self { Self { diff --git a/src/fdo/monitoring.rs b/src/fdo/monitoring.rs index fbbfc4f..98f449f 100644 --- a/src/fdo/monitoring.rs +++ b/src/fdo/monitoring.rs @@ -18,8 +18,8 @@ pub struct Monitoring { } impl Monitoring { - pub const PATH: &str = "/org/freedesktop/DBus"; - pub const INTERFACE: &str = "org.freedesktop.DBus.Monitoring"; + pub const PATH: &'static str = "/org/freedesktop/DBus"; + pub const INTERFACE: &'static str = "org.freedesktop.DBus.Monitoring"; pub fn new(peers: Arc) -> Self { Self {