Skip to content

Commit 1cdfd4c

Browse files
rustfmt: Enable an extra feature
Reduce useless '_' in the code
1 parent de6adc7 commit 1cdfd4c

3 files changed

Lines changed: 8 additions & 10 deletions

File tree

.rustfmt.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ newline_style = "Unix"
55
normalize_comments = true
66
normalize_doc_attributes = true
77
wrap_comments = true
8+
condense_wildcard_suffixes = true

client/src/keyring.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ impl Item {
400400
T: for<'a> std::convert::TryFrom<&'a HashMap<String, String>, Error = crate::SchemaError>,
401401
{
402402
match self {
403-
Self::File(_, _) => T::try_from(&self.attributes().await?)
403+
Self::File(..) => T::try_from(&self.attributes().await?)
404404
.map_err(crate::file::Error::Schema)
405405
.map_err(Into::into),
406406
Self::DBus(_) => T::try_from(&self.attributes().await?)

server/src/service/tests.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,7 +1159,7 @@ async fn discover_v1_keyrings() -> Result<(), Box<dyn std::error::Error>> {
11591159

11601160
let work_keyring = discovered
11611161
.iter()
1162-
.find(|(_, label, _, _)| label == "Work")
1162+
.find(|(_, label, ..)| label == "Work")
11631163
.unwrap();
11641164
assert!(
11651165
!work_keyring.3.is_locked(),
@@ -1168,7 +1168,7 @@ async fn discover_v1_keyrings() -> Result<(), Box<dyn std::error::Error>> {
11681168

11691169
let personal_keyring = discovered
11701170
.iter()
1171-
.find(|(_, label, _, _)| label == "Personal")
1171+
.find(|(_, label, ..)| label == "Personal")
11721172
.unwrap();
11731173
assert!(
11741174
personal_keyring.3.is_locked(),
@@ -1178,7 +1178,7 @@ async fn discover_v1_keyrings() -> Result<(), Box<dyn std::error::Error>> {
11781178
// Test 4: Verify login keyring gets default alias
11791179
let login_keyring = discovered
11801180
.iter()
1181-
.find(|(_, label, _, _)| label == "Login")
1181+
.find(|(_, label, ..)| label == "Login")
11821182
.unwrap();
11831183
assert_eq!(
11841184
login_keyring.2,
@@ -1193,7 +1193,7 @@ async fn discover_v1_keyrings() -> Result<(), Box<dyn std::error::Error>> {
11931193
// Test 5: Verify labels are properly capitalized
11941194
let labels: Vec<_> = discovered
11951195
.iter()
1196-
.map(|(_, label, _, _)| label.as_str())
1196+
.map(|(_, label, ..)| label.as_str())
11971197
.collect();
11981198
assert!(labels.contains(&"Work"), "Should have Work with capital W");
11991199
assert!(
@@ -1355,10 +1355,7 @@ async fn discover_v0_keyrings() -> Result<(), Box<dyn std::error::Error>> {
13551355
let discovered = service.discover_keyrings(Some(v0_secret.clone())).await?;
13561356
assert_eq!(discovered.len(), 2, "Should discover both keyrings");
13571357

1358-
let legacy = discovered
1359-
.iter()
1360-
.find(|(_, l, _, _)| l == "Legacy")
1361-
.unwrap();
1358+
let legacy = discovered.iter().find(|(_, l, ..)| l == "Legacy").unwrap();
13621359
assert!(!legacy.3.is_locked(), "V0 should be migrated and unlocked");
13631360
assert_eq!(
13641361
service.pending_migrations.lock().await.len(),
@@ -1453,7 +1450,7 @@ async fn discover_kwallet_keyrings() -> Result<(), Box<dyn std::error::Error>> {
14531450

14541451
let kdewallet = discovered
14551452
.iter()
1456-
.find(|(_, l, _, _)| l == "Kdewallet")
1453+
.find(|(_, l, ..)| l == "Kdewallet")
14571454
.unwrap();
14581455
assert!(
14591456
!kdewallet.3.is_locked(),

0 commit comments

Comments
 (0)