Skip to content

Commit 50f8b01

Browse files
committed
Make default attributes consistent between secret-service and windows.
1 parent a5533e0 commit 50f8b01

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/secret_service.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ impl SsCredential {
255255
Ok(Self {
256256
attributes,
257257
label: format!(
258-
"keyring v{}: {user}@{service}:{target}",
258+
"{user}@{service}:{target} (keyring v{})",
259259
env!("CARGO_PKG_VERSION"),
260260
),
261261
target: Some(target.to_string()),

src/windows.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,6 @@ impl WinCredential {
339339
user: &str,
340340
) -> Result<WinCredential> {
341341
const VERSION: &str = env!("CARGO_PKG_VERSION");
342-
let metadata = format!("keyring-rs v{VERSION} for service '{service}', user '{user}'");
343342
let credential = if let Some(target) = target {
344343
// if target.is_empty() {
345344
// return Err(ErrorCode::Invalid(
@@ -354,7 +353,7 @@ impl WinCredential {
354353
username: user.to_string(),
355354
target_name: target.to_string(),
356355
target_alias: String::new(),
357-
comment: metadata,
356+
comment: format!("{user}@{service}:{target} (keyring v{VERSION})"),
358357
}
359358
} else {
360359
Self {
@@ -369,7 +368,7 @@ impl WinCredential {
369368
username: user.to_string(),
370369
target_name: format!("{user}.{service}"),
371370
target_alias: String::new(),
372-
comment: metadata,
371+
comment: format!("{user}@{service}:{user}.{service} (keyring v{VERSION})"),
373372
}
374373
};
375374
credential.validate_attributes(None, None)?;

0 commit comments

Comments
 (0)