Skip to content

Commit

Permalink
fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
tomleavy committed Jan 5, 2024
1 parent 07cc93a commit 290fb56
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
5 changes: 4 additions & 1 deletion mls-rs/src/group/state_repo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,10 @@ mod tests {
assert_eq!(test_repo.pending_commit.updates.len(), 1);
assert!(test_repo.pending_commit.inserts.is_empty());

assert_eq!(test_repo.pending_commit.updates.get(0).unwrap(), &to_update);
assert_eq!(
test_repo.pending_commit.updates.first().unwrap(),
&to_update
);

// Make sure you can access an epoch pending update
let psk_id = ResumptionPsk {
Expand Down
8 changes: 2 additions & 6 deletions mls-rs/src/tree_kem/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1266,12 +1266,8 @@ mod tests {
let original_leaf_count = tree.occupied_leaf_count();

// Remove two leaves from the tree
let expected_result: Vec<(LeafIndex, LeafNode)> = indexes
.clone()
.into_iter()
.zip(key_packages)
.map(|(index, ln)| (index, ln))
.collect();
let expected_result: Vec<(LeafIndex, LeafNode)> =
indexes.clone().into_iter().zip(key_packages).collect();

let res = tree
.remove_leaves(
Expand Down
4 changes: 2 additions & 2 deletions mls-rs/src/tree_kem/private.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ mod tests {
let (public_tree, mut charlie_private, alice_private, path_secret) =
update_secrets_setup(cipher_suite).await;

let existing_private = charlie_private.secret_keys.get(0).cloned().unwrap();
let existing_private = charlie_private.secret_keys.first().cloned().unwrap();

// Add the secrets for Charlie to his private key
charlie_private
Expand Down Expand Up @@ -295,6 +295,6 @@ mod tests {
assert!(private_key.secret_keys.iter().skip(1).all(|n| n.is_none()));

// The secret key for our leaf should have been updated accordingly
assert_eq!(private_key.secret_keys.get(0).unwrap(), &Some(new_secret));
assert_eq!(private_key.secret_keys.first().unwrap(), &Some(new_secret));
}
}

0 comments on commit 290fb56

Please sign in to comment.