Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use const rather than static for str #62

Merged
merged 1 commit into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions client/src/dbus/api/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pub(crate) static DESTINATION: &str = "org.freedesktop.secrets";
pub(crate) static PATH: &str = "/org/freedesktop/secrets";
pub(crate) const DESTINATION: &str = "org.freedesktop.secrets";
pub(crate) const PATH: &str = "/org/freedesktop/secrets";

/// A common trait implemented by objects that can be
/// locked or unlocked. Like [`Collection`] or [`Item`].
Expand Down
6 changes: 3 additions & 3 deletions client/src/dbus/api/properties.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ use std::collections::HashMap;
use serde::ser::{Serialize, SerializeMap};
use zbus::zvariant::{Type, Value};

static ITEM_PROPERTY_LABEL: &str = "org.freedesktop.Secret.Item.Label";
static ITEM_PROPERTY_ATTRIBUTES: &str = "org.freedesktop.Secret.Item.Attributes";
const ITEM_PROPERTY_LABEL: &str = "org.freedesktop.Secret.Item.Label";
const ITEM_PROPERTY_ATTRIBUTES: &str = "org.freedesktop.Secret.Item.Attributes";

static COLLECTION_PROPERTY_LABEL: &str = "org.freedesktop.Secret.Collection.Label";
const COLLECTION_PROPERTY_LABEL: &str = "org.freedesktop.Secret.Collection.Label";

#[derive(Debug, Type)]
#[zvariant(signature = "a{sv}")]
Expand Down
4 changes: 2 additions & 2 deletions client/src/dbus/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@
/// The default collection alias.
///
/// In general, you are supposed to use [`Service::default_collection`].
pub static DEFAULT_COLLECTION: &str = "default";
pub const DEFAULT_COLLECTION: &str = "default";

/// A session collection.
///
/// The collection is cleared when the user ends the session.
pub static SESSION_COLLECTION: &str = "session";
pub const SESSION_COLLECTION: &str = "session";

/// Barebone DBus API of the Secret Service specifications.
///
Expand Down
Loading