Skip to content

Commit 2a81f32

Browse files
A6GibKmbilelmoussaoui
authored andcommitted
Use const rather than static for str
A static is like a const that can be mutated, we don't do that.
1 parent 65842e8 commit 2a81f32

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

client/src/dbus/api/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
pub(crate) static DESTINATION: &str = "org.freedesktop.secrets";
2-
pub(crate) static PATH: &str = "/org/freedesktop/secrets";
1+
pub(crate) const DESTINATION: &str = "org.freedesktop.secrets";
2+
pub(crate) const PATH: &str = "/org/freedesktop/secrets";
33

44
/// A common trait implemented by objects that can be
55
/// locked or unlocked. Like [`Collection`] or [`Item`].

client/src/dbus/api/properties.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ use std::collections::HashMap;
33
use serde::ser::{Serialize, SerializeMap};
44
use zbus::zvariant::{Type, Value};
55

6-
static ITEM_PROPERTY_LABEL: &str = "org.freedesktop.Secret.Item.Label";
7-
static ITEM_PROPERTY_ATTRIBUTES: &str = "org.freedesktop.Secret.Item.Attributes";
6+
const ITEM_PROPERTY_LABEL: &str = "org.freedesktop.Secret.Item.Label";
7+
const ITEM_PROPERTY_ATTRIBUTES: &str = "org.freedesktop.Secret.Item.Attributes";
88

9-
static COLLECTION_PROPERTY_LABEL: &str = "org.freedesktop.Secret.Collection.Label";
9+
const COLLECTION_PROPERTY_LABEL: &str = "org.freedesktop.Secret.Collection.Label";
1010

1111
#[derive(Debug, Type)]
1212
#[zvariant(signature = "a{sv}")]

client/src/dbus/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@
3535
/// The default collection alias.
3636
///
3737
/// In general, you are supposed to use [`Service::default_collection`].
38-
pub static DEFAULT_COLLECTION: &str = "default";
38+
pub const DEFAULT_COLLECTION: &str = "default";
3939

4040
/// A session collection.
4141
///
4242
/// The collection is cleared when the user ends the session.
43-
pub static SESSION_COLLECTION: &str = "session";
43+
pub const SESSION_COLLECTION: &str = "session";
4444

4545
/// Barebone DBus API of the Secret Service specifications.
4646
///

0 commit comments

Comments
 (0)