diff --git a/src/olm/session/double_ratchet.rs b/src/olm/session/double_ratchet.rs index 85c59a61..392a93e1 100644 --- a/src/olm/session/double_ratchet.rs +++ b/src/olm/session/double_ratchet.rs @@ -339,13 +339,10 @@ mod test { fn create_session_pair(alice: &Account, bob: &mut Account) -> (Session, Session) { let bob_otks = bob.generate_one_time_keys(1); - let bob_otk = bob_otks.created.get(0).expect("Couldn't get a one-time-key for bob"); + let bob_otk = bob_otks.created.first().expect("Couldn't get a one-time-key for bob"); let bob_identity_key = bob.identity_keys().curve25519; - let mut alice_session = alice.create_outbound_session( - SessionConfig::version_1(), - bob_identity_key, - bob_otk.clone(), - ); + let mut alice_session = + alice.create_outbound_session(SessionConfig::version_1(), bob_identity_key, *bob_otk); let message = "It's a secret to everybody"; let olm_message = alice_session.encrypt(message); @@ -353,7 +350,7 @@ mod test { let alice_identity_key = alice.identity_keys().curve25519; let bob_session_creation_result = bob - .create_inbound_session(alice_identity_key.clone(), &prekey_message) + .create_inbound_session(alice_identity_key, &prekey_message) .expect("Unable to create inbound session"); assert_eq!(bob_session_creation_result.plaintext, message.as_bytes()); (alice_session, bob_session_creation_result.session)