Skip to content

Commit

Permalink
🚨 Explicit lifetimes for constant string literals
Browse files Browse the repository at this point in the history
```
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 <rust-lang/rust#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";
   |                      +++++++
```
Zeeshan Ali Khan committed Jan 30, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent fb8b5ca commit c756be5
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/fdo/dbus.rs
Original file line number Diff line number Diff line change
@@ -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<Peers>, guid: Arc<Guid>) -> Self {
Self {
4 changes: 2 additions & 2 deletions src/fdo/monitoring.rs
Original file line number Diff line number Diff line change
@@ -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<Peers>) -> Self {
Self {

0 comments on commit c756be5

Please sign in to comment.