From 74a6d39b9f9f980ba9f49743cd6048d4d1c64446 Mon Sep 17 00:00:00 2001 From: Jonathan de Jong Date: Sat, 5 Jun 2021 14:35:20 +0200 Subject: [PATCH 1/3] various typos --- .../examples/cross_signing_bootstrap.rs | 2 +- matrix_sdk/src/client.rs | 2 +- matrix_sdk/src/event_handler/mod.rs | 2 +- matrix_sdk/src/room/common.rs | 4 ++-- matrix_sdk/src/room/invited.rs | 2 +- matrix_sdk/src/room/joined.rs | 2 +- matrix_sdk/src/room/left.rs | 2 +- matrix_sdk/src/sas.rs | 2 +- matrix_sdk_appservice/src/lib.rs | 2 +- matrix_sdk_base/src/client.rs | 4 ++-- matrix_sdk_base/src/rooms/normal.rs | 4 ++-- .../src/deserialized_responses.rs | 6 ++--- .../src/file_encryption/key_export.rs | 2 +- matrix_sdk_crypto/src/identities/device.rs | 2 +- matrix_sdk_crypto/src/identities/manager.rs | 2 +- matrix_sdk_crypto/src/identities/mod.rs | 2 +- matrix_sdk_crypto/src/key_request.rs | 10 ++++----- matrix_sdk_crypto/src/machine.rs | 22 +++++++++---------- .../src/olm/group_sessions/inbound.rs | 14 ++++++------ matrix_sdk_crypto/src/olm/session.rs | 4 ++-- .../src/session_manager/group_sessions.rs | 2 +- matrix_sdk_crypto/src/store/mod.rs | 10 ++++----- matrix_sdk_crypto/src/verification/machine.rs | 10 ++++----- .../src/verification/requests.rs | 4 ++-- .../src/verification/sas/sas_state.rs | 2 +- 25 files changed, 60 insertions(+), 60 deletions(-) diff --git a/matrix_sdk/examples/cross_signing_bootstrap.rs b/matrix_sdk/examples/cross_signing_bootstrap.rs index 9d1061d4..107cfc58 100644 --- a/matrix_sdk/examples/cross_signing_bootstrap.rs +++ b/matrix_sdk/examples/cross_signing_bootstrap.rs @@ -40,7 +40,7 @@ async fn bootstrap(client: Client, user_id: UserId, password: String) { .await .expect("Couldn't bootstrap cross signing") } else { - panic!("Error durign cross signing bootstrap {:#?}", e); + panic!("Error during cross-signing bootstrap {:#?}", e); } } diff --git a/matrix_sdk/src/client.rs b/matrix_sdk/src/client.rs index 646637cd..09ba72f4 100644 --- a/matrix_sdk/src/client.rs +++ b/matrix_sdk/src/client.rs @@ -139,7 +139,7 @@ const MIN_UPLOAD_REQUEST_TIMEOUT: Duration = Duration::from_secs(60 * 5); /// The range of ports the SSO server will try to bind to randomly #[cfg(feature = "sso_login")] const SSO_SERVER_BIND_RANGE: Range = 20000..30000; -/// The number of timesthe SSO server will try to bind to a random port +/// The number of times the SSO server will try to bind to a random port #[cfg(feature = "sso_login")] const SSO_SERVER_BIND_TRIES: u8 = 10; diff --git a/matrix_sdk/src/event_handler/mod.rs b/matrix_sdk/src/event_handler/mod.rs index 53c46784..7a8b3ab1 100644 --- a/matrix_sdk/src/event_handler/mod.rs +++ b/matrix_sdk/src/event_handler/mod.rs @@ -215,7 +215,7 @@ impl Handler { pub(crate) async fn handle_stripped_state_event( &self, - // TODO these events are only handleted in invited rooms. + // TODO these events are only handled in invited rooms. room: Room, event: &AnyStrippedStateEvent, ) { diff --git a/matrix_sdk/src/room/common.rs b/matrix_sdk/src/room/common.rs index cff99001..e67536a5 100644 --- a/matrix_sdk/src/room/common.rs +++ b/matrix_sdk/src/room/common.rs @@ -12,7 +12,7 @@ use matrix_sdk_common::{ use crate::{BaseRoom, Client, Result, RoomMember}; -/// A struct containing methodes that are common for Joined, Invited and Left +/// A struct containing methods that are common for Joined, Invited and Left /// Rooms #[derive(Debug, Clone)] pub struct Common { @@ -55,7 +55,7 @@ impl Common { /// Only invited and left rooms can be joined via this method pub(crate) async fn join(&self) -> Result<()> { let request = join_room_by_id::Request::new(self.inner.room_id()); - let _resposne = self.client.send(request, None).await?; + let _response = self.client.send(request, None).await?; Ok(()) } diff --git a/matrix_sdk/src/room/invited.rs b/matrix_sdk/src/room/invited.rs index 3ff681e4..1d809271 100644 --- a/matrix_sdk/src/room/invited.rs +++ b/matrix_sdk/src/room/invited.rs @@ -4,7 +4,7 @@ use crate::{room::Common, BaseRoom, Client, Result, RoomType}; /// A room in the invited state. /// -/// This struct contains all methodes specific to a `Room` with type +/// This struct contains all methods specific to a `Room` with type /// `RoomType::Invited`. Operations may fail once the underlying `Room` changes /// `RoomType`. #[derive(Debug, Clone)] diff --git a/matrix_sdk/src/room/joined.rs b/matrix_sdk/src/room/joined.rs index 2741bf69..3adb477a 100644 --- a/matrix_sdk/src/room/joined.rs +++ b/matrix_sdk/src/room/joined.rs @@ -47,7 +47,7 @@ const TYPING_NOTICE_RESEND_TIMEOUT: Duration = Duration::from_secs(3); /// A room in the joined state. /// -/// The `JoinedRoom` contains all methodes specific to a `Room` with type +/// The `JoinedRoom` contains all methods specific to a `Room` with type /// `RoomType::Joined`. Operations may fail once the underlying `Room` changes /// `RoomType`. #[derive(Debug, Clone)] diff --git a/matrix_sdk/src/room/left.rs b/matrix_sdk/src/room/left.rs index 0714f6c0..5baded8c 100644 --- a/matrix_sdk/src/room/left.rs +++ b/matrix_sdk/src/room/left.rs @@ -6,7 +6,7 @@ use crate::{room::Common, BaseRoom, Client, Result, RoomType}; /// A room in the left state. /// -/// This struct contains all methodes specific to a `Room` with type +/// This struct contains all methods specific to a `Room` with type /// `RoomType::Left`. Operations may fail once the underlying `Room` changes /// `RoomType`. #[derive(Debug, Clone)] diff --git a/matrix_sdk/src/sas.rs b/matrix_sdk/src/sas.rs index 31de78ed..42949feb 100644 --- a/matrix_sdk/src/sas.rs +++ b/matrix_sdk/src/sas.rs @@ -137,7 +137,7 @@ impl Sas { self.inner.is_cancelled() } - /// Get the other users device that we're veryfying. + /// Get the other users device that we're verifying. pub fn other_device(&self) -> &ReadOnlyDevice { self.inner.other_device() } diff --git a/matrix_sdk_appservice/src/lib.rs b/matrix_sdk_appservice/src/lib.rs index 8a9d0b79..7aab474b 100644 --- a/matrix_sdk_appservice/src/lib.rs +++ b/matrix_sdk_appservice/src/lib.rs @@ -214,7 +214,7 @@ impl Appservice { /// * `server_name` - The server name to use when constructing user ids from /// the localpart. /// * `registration` - The [Appservice Registration] to use when interacting - /// with the homserver. + /// with the homeserver. /// /// [Appservice Registration]: https://matrix.org/docs/spec/application_service/r0.1.2#registration pub async fn new( diff --git a/matrix_sdk_base/src/client.rs b/matrix_sdk_base/src/client.rs index 4bfedba4..79c45ea7 100644 --- a/matrix_sdk_base/src/client.rs +++ b/matrix_sdk_base/src/client.rs @@ -749,8 +749,8 @@ impl BaseClient { if let Some(o) = &*olm { // Let the crypto machine handle the sync response, this - // decryptes to-device events, but leaves room events alone. - // This makes sure that we have the deryption keys for the room + // decrypts to-device events, but leaves room events alone. + // This makes sure that we have the decryption keys for the room // events at hand. o.receive_sync_changes(to_device, &device_lists, &device_one_time_keys_count) .await? diff --git a/matrix_sdk_base/src/rooms/normal.rs b/matrix_sdk_base/src/rooms/normal.rs index 6e2fc03c..de01c8c0 100644 --- a/matrix_sdk_base/src/rooms/normal.rs +++ b/matrix_sdk_base/src/rooms/normal.rs @@ -46,7 +46,7 @@ use crate::{ }; /// The underlying room data structure collecting state for joined, left and -/// invtied rooms. +/// invited rooms. #[derive(Debug, Clone)] pub struct Room { room_id: Arc, @@ -178,7 +178,7 @@ impl Room { /// If this room is a direct message, get the member that we're sharing the /// room with. /// - /// *Note*: The member list might have been moddified in the meantime and + /// *Note*: The member list might have been modified in the meantime and /// the target might not even be in the room anymore. This setting should /// only be considered as guidance. pub fn direct_target(&self) -> Option { diff --git a/matrix_sdk_common/src/deserialized_responses.rs b/matrix_sdk_common/src/deserialized_responses.rs index 6582b0d2..0ed970a5 100644 --- a/matrix_sdk_common/src/deserialized_responses.rs +++ b/matrix_sdk_common/src/deserialized_responses.rs @@ -120,7 +120,7 @@ pub struct SyncResponse { pub presence: Presence, /// The global private data created by this user. pub account_data: GlobalAccountData, - /// Messages sent dirrectly between devices. + /// Messages sent directly between devices. pub to_device: ToDevice, /// Information on E2E device updates. /// @@ -129,7 +129,7 @@ pub struct SyncResponse { /// For each key algorithm, the number of unclaimed one-time keys /// currently held on the server for a device. pub device_one_time_keys_count: BTreeMap, - /// Collection of ambiguioty changes that room member events trigger. + /// Collection of ambiguity changes that room member events trigger. pub ambiguity_changes: AmbiguityChanges, /// New notifications per room. pub notifications: BTreeMap>, @@ -343,6 +343,6 @@ impl From for StrippedStateEvent { pub struct MembersResponse { /// The list of members events. pub chunk: Vec, - /// Collection of ambiguioty changes that room member events trigger. + /// Collection of ambiguity changes that room member events trigger. pub ambiguity_changes: AmbiguityChanges, } diff --git a/matrix_sdk_crypto/src/file_encryption/key_export.rs b/matrix_sdk_crypto/src/file_encryption/key_export.rs index 6f64c0be..957238b2 100644 --- a/matrix_sdk_crypto/src/file_encryption/key_export.rs +++ b/matrix_sdk_crypto/src/file_encryption/key_export.rs @@ -115,7 +115,7 @@ pub fn decrypt_key_export( /// /// * `rounds` - The number of rounds that should be used for the key /// derivation when the passphrase gets turned into an AES key. More rounds are -/// increasingly computationally intensive and as such help against bruteforce +/// increasingly computationally intensive and as such help against brute-force /// attacks. Should be at least `10000`, while values in the `100000` ranges /// should be preferred. /// diff --git a/matrix_sdk_crypto/src/identities/device.rs b/matrix_sdk_crypto/src/identities/device.rs index 63d9853c..e2293eaf 100644 --- a/matrix_sdk_crypto/src/identities/device.rs +++ b/matrix_sdk_crypto/src/identities/device.rs @@ -385,7 +385,7 @@ impl ReadOnlyDevice { // only the identity is trusted, if the identity and the device are // trusted. if self.is_trusted() { - // If the device is localy marked as verified just return so, no + // If the device is locally marked as verified just return so, no // need to check signatures. true } else { diff --git a/matrix_sdk_crypto/src/identities/manager.rs b/matrix_sdk_crypto/src/identities/manager.rs index 734591f8..5ef53d40 100644 --- a/matrix_sdk_crypto/src/identities/manager.rs +++ b/matrix_sdk_crypto/src/identities/manager.rs @@ -320,7 +320,7 @@ impl IdentityManager { /// Get a key query request if one is needed. /// - /// Returns a key query reqeust if the client should query E2E keys, + /// Returns a key query request if the client should query E2E keys, /// otherwise None. /// /// The response of a successful key query requests needs to be passed to diff --git a/matrix_sdk_crypto/src/identities/mod.rs b/matrix_sdk_crypto/src/identities/mod.rs index 3a703093..873cecfa 100644 --- a/matrix_sdk_crypto/src/identities/mod.rs +++ b/matrix_sdk_crypto/src/identities/mod.rs @@ -38,7 +38,7 @@ //! additional public keys for other users, while it will give us access to all //! 3 for our own user. //! -//! Both identity sets need to reqularly fetched from the server using the +//! Both identity sets need to regularly fetched from the server using the //! `/keys/query` API call. pub(crate) mod device; mod manager; diff --git a/matrix_sdk_crypto/src/key_request.rs b/matrix_sdk_crypto/src/key_request.rs index f1dbb43a..c13123bf 100644 --- a/matrix_sdk_crypto/src/key_request.rs +++ b/matrix_sdk_crypto/src/key_request.rs @@ -161,7 +161,7 @@ impl OutgoingKeyRequest { wrap_key_request_content(self.request_recipient.clone(), self.request_id, &content) } - fn to_cancelation( + fn to_cancellation( &self, own_device_id: &DeviceId, ) -> Result { @@ -594,7 +594,7 @@ impl KeyRequestMachine { let request = self.store.get_key_request_by_info(&key_info).await?; if let Some(request) = request { - let cancel = request.to_cancelation(self.device_id())?; + let cancel = request.to_cancellation(self.device_id())?; let request = request.to_request(self.device_id())?; Ok((Some(cancel), request)) @@ -707,7 +707,7 @@ impl KeyRequestMachine { /// Mark the given outgoing key info as done. /// - /// This will queue up a request cancelation. + /// This will queue up a request cancellation. async fn mark_as_done(&self, key_info: OutgoingKeyRequest) -> Result<(), CryptoStoreError> { // TODO perhaps only remove the key info if the first known index is 0. trace!("Successfully received a forwarded room key for {:#?}", key_info); @@ -717,7 +717,7 @@ impl KeyRequestMachine { // can delete it in one transaction. self.delete_key_info(&key_info).await?; - let request = key_info.to_cancelation(self.device_id())?; + let request = key_info.to_cancellation(self.device_id())?; self.outgoing_to_device_requests.insert(request.request_id, request); Ok(()) @@ -1351,7 +1351,7 @@ mod test { // Receive the room key request from alice. bob_machine.receive_incoming_key_request(&event); bob_machine.collect_incoming_key_requests().await.unwrap(); - // Bob doens't have an outgoing requests since we're lacking a session. + // Bob doesn't have an outgoing requests since we're lacking a session. assert!(bob_machine.outgoing_to_device_requests().await.unwrap().is_empty()); assert!(!bob_machine.users_for_key_claim.is_empty()); assert!(!bob_machine.wait_queue.is_empty()); diff --git a/matrix_sdk_crypto/src/machine.rs b/matrix_sdk_crypto/src/machine.rs index fc6734d2..9246686f 100644 --- a/matrix_sdk_crypto/src/machine.rs +++ b/matrix_sdk_crypto/src/machine.rs @@ -76,7 +76,7 @@ pub struct OlmMachine { account: Account, /// The private part of our cross signing identity. /// Used to sign devices and other users, might be missing if some other - /// device bootstraped cross signing or cross signing isn't bootstrapped at + /// device bootstrapped cross signing or cross signing isn't bootstrapped at /// all. user_identity: Arc>, /// Store for the encryption keys. @@ -735,7 +735,7 @@ impl OlmMachine { self.account.update_uploaded_key_count(key_count).await; } - async fn handle_to_device_evnet(&self, event: &AnyToDeviceEvent) { + async fn handle_to_device_event(&self, event: &AnyToDeviceEvent) { match event { AnyToDeviceEvent::RoomKeyRequest(e) => { self.key_request_machine.receive_incoming_key_request(&e) @@ -771,7 +771,7 @@ impl OlmMachine { /// response. /// /// * `changed_devices` - The list of devices that changed in this sync - /// resopnse. + /// response. /// /// * `one_time_keys_count` - The current one-time keys counts that the sync /// response returned. @@ -855,12 +855,12 @@ impl OlmMachine { } if let Some(event) = decrypted.deserialized_event { - self.handle_to_device_evnet(&event).await; + self.handle_to_device_event(&event).await; } raw_event = decrypted.event; } - e => self.handle_to_device_evnet(&e).await, + e => self.handle_to_device_event(&e).await, } events.push(raw_event); @@ -880,11 +880,11 @@ impl OlmMachine { /// Request a room key from our devices. /// - /// This method will return a request cancelation and a new key request if + /// This method will return a request cancellation and a new key request if /// the key was already requested, otherwise it will return just the key /// request. /// - /// The request cancelation *must* be sent out before the request is sent + /// The request cancellation *must* be sent out before the request is sent /// out, otherwise devices will ignore the key request. /// /// # Arguments @@ -942,7 +942,7 @@ impl OlmMachine { algorithm_info: AlgorithmInfo::MegolmV1AesSha2 { curve25519_key: session.sender_key().to_owned(), sender_claimed_keys: session.signing_keys().to_owned(), - forwarding_curve25519_key_chain: session.forwading_key_chain().to_vec(), + forwarding_curve25519_key_chain: session.forwarding_key_chain().to_vec(), }, verification_state, }) @@ -1167,7 +1167,7 @@ impl OlmMachine { /// /// * `predicate` - A closure that will be called for every known /// `InboundGroupSession`, which represents a room key. If the closure - /// returns `true` the `InboundGroupSessoin` will be included in the export, + /// returns `true` the `InboundGroupSession` will be included in the export, /// if the closure returns `false` it will not be included. /// /// # Panics @@ -1318,10 +1318,10 @@ pub(crate) mod test { let alice_device = alice_device_id(); let alice = OlmMachine::new(&alice_id, &alice_device); - let alice_deivce = ReadOnlyDevice::from_machine(&alice).await; + let alice_device = ReadOnlyDevice::from_machine(&alice).await; let bob_device = ReadOnlyDevice::from_machine(&bob).await; alice.store.save_devices(&[bob_device]).await.unwrap(); - bob.store.save_devices(&[alice_deivce]).await.unwrap(); + bob.store.save_devices(&[alice_device]).await.unwrap(); (alice, bob, otk) } diff --git a/matrix_sdk_crypto/src/olm/group_sessions/inbound.rs b/matrix_sdk_crypto/src/olm/group_sessions/inbound.rs index 957fbed8..4dfc0c5e 100644 --- a/matrix_sdk_crypto/src/olm/group_sessions/inbound.rs +++ b/matrix_sdk_crypto/src/olm/group_sessions/inbound.rs @@ -42,9 +42,9 @@ use zeroize::Zeroizing; use super::{ExportedGroupSessionKey, ExportedRoomKey, GroupSessionKey}; use crate::error::{EventError, MegolmResult}; -// TODO add creation times to the inbound grop sessions so we can export +// TODO add creation times to the inbound group sessions so we can export // sessions that were created between some time period, this should only be set -// for non-imported sessoins. +// for non-imported sessions. /// Inbound group session. /// @@ -172,7 +172,7 @@ impl InboundGroupSession { sender_key: self.sender_key.to_string(), signing_key: (&*self.signing_keys).clone(), room_id: (&*self.room_id).clone(), - forwarding_chains: self.forwading_key_chain().to_vec(), + forwarding_chains: self.forwarding_key_chain().to_vec(), imported: *self.imported, history_visibility: self.history_visibility.as_ref().clone(), } @@ -201,7 +201,7 @@ impl InboundGroupSession { /// Each ed25519 key represents a single device. If device A forwards the /// session to device B and device B to C this list will contain the ed25519 /// keys of A and B. - pub fn forwading_key_chain(&self) -> &[String] { + pub fn forwarding_key_chain(&self) -> &[String] { &self.forwarding_chains } @@ -218,7 +218,7 @@ impl InboundGroupSession { room_id: (&*self.room_id).clone(), sender_key: (&*self.sender_key).to_owned(), session_id: self.session_id().to_owned(), - forwarding_curve25519_key_chain: self.forwading_key_chain().to_vec(), + forwarding_curve25519_key_chain: self.forwarding_key_chain().to_vec(), sender_claimed_keys: (&*self.signing_keys).clone(), session_key, } @@ -361,10 +361,10 @@ pub struct PickledInboundGroupSession { /// The id of the room that the session is used in. pub room_id: RoomId, /// The list of claimed ed25519 that forwarded us this key. Will be None if - /// we dirrectly received this session. + /// we directly received this session. #[serde(default)] pub forwarding_chains: Vec, - /// Flag remembering if the session was dirrectly sent to us by the sender + /// Flag remembering if the session was directly sent to us by the sender /// or if it was imported. pub imported: bool, /// History visibility of the room when the session was created. diff --git a/matrix_sdk_crypto/src/olm/session.rs b/matrix_sdk_crypto/src/olm/session.rs index d89c2841..2c679df6 100644 --- a/matrix_sdk_crypto/src/olm/session.rs +++ b/matrix_sdk_crypto/src/olm/session.rs @@ -265,8 +265,8 @@ pub struct PickledSession { pub struct SessionPickle(String); impl From for SessionPickle { - fn from(picle_string: String) -> Self { - SessionPickle(picle_string) + fn from(pickle_string: String) -> Self { + SessionPickle(pickle_string) } } diff --git a/matrix_sdk_crypto/src/session_manager/group_sessions.rs b/matrix_sdk_crypto/src/session_manager/group_sessions.rs index 06bc2399..08498ad0 100644 --- a/matrix_sdk_crypto/src/session_manager/group_sessions.rs +++ b/matrix_sdk_crypto/src/session_manager/group_sessions.rs @@ -503,7 +503,7 @@ impl GroupSessionManager { .collect(); for result in join_all(tasks).await { - let used_sessions: OlmResult> = result.expect("Encryption task paniced"); + let used_sessions: OlmResult> = result.expect("Encryption task panicked"); changes.sessions.extend(used_sessions?); } diff --git a/matrix_sdk_crypto/src/store/mod.rs b/matrix_sdk_crypto/src/store/mod.rs index edb4587f..512181e5 100644 --- a/matrix_sdk_crypto/src/store/mod.rs +++ b/matrix_sdk_crypto/src/store/mod.rs @@ -279,7 +279,7 @@ pub enum CryptoStoreError { #[error("An object failed to be decrypted while unpickling")] UnpicklingError, - /// A Matirx identifier failed to be validated. + /// A Matrix identifier failed to be validated. #[error(transparent)] IdentifierValidation(#[from] IdentifierValidationError), @@ -338,7 +338,7 @@ pub trait CryptoStore: AsyncTraitDeps { /// Get all the inbound group sessions we have stored. async fn get_inbound_group_sessions(&self) -> Result>; - /// Get the outobund group sessions we have stored that is used for the + /// Get the outbound group sessions we have stored that is used for the /// given room. async fn get_outbound_group_sessions( &self, @@ -399,7 +399,7 @@ pub trait CryptoStore: AsyncTraitDeps { /// Check if a hash for an Olm message stored in the database. async fn is_message_known(&self, message_hash: &OlmMessageHash) -> Result; - /// Get an outoing key request that we created that matches the given + /// Get an outgoing key request that we created that matches the given /// request id. /// /// # Arguments @@ -411,7 +411,7 @@ pub trait CryptoStore: AsyncTraitDeps { request_id: Uuid, ) -> Result>; - /// Get an outoing key request that we created that matches the given + /// Get an outgoing key request that we created that matches the given /// requested key info. /// /// # Arguments @@ -425,7 +425,7 @@ pub trait CryptoStore: AsyncTraitDeps { /// Get all outgoing key requests that we have in the store. async fn get_unsent_key_requests(&self) -> Result>; - /// Delete an outoing key request that we created that matches the given + /// Delete an outgoing key request that we created that matches the given /// request id. /// /// # Arguments diff --git a/matrix_sdk_crypto/src/verification/machine.rs b/matrix_sdk_crypto/src/verification/machine.rs index e569321c..5568bea5 100644 --- a/matrix_sdk_crypto/src/verification/machine.rs +++ b/matrix_sdk_crypto/src/verification/machine.rs @@ -167,7 +167,7 @@ impl VerificationMachine { return Ok(()); }; - let flow_id_missmatch = || { + let flow_id_mismatch = || { warn!( sender = event.sender().as_str(), flow_id = flow_id.as_str(), @@ -215,7 +215,7 @@ impl VerificationMachine { // TODO remove this unwrap. request.receive_ready(event.sender(), c).unwrap(); } else { - flow_id_missmatch(); + flow_id_mismatch(); } } } @@ -224,7 +224,7 @@ impl VerificationMachine { if request.flow_id() == &flow_id { request.receive_start(event.sender(), &c).await? } else { - flow_id_missmatch(); + flow_id_mismatch(); } } else if let FlowId::ToDevice(_) = flow_id { // TODO remove this soon, this has been deprecated by @@ -268,7 +268,7 @@ impl VerificationMachine { ); } } else { - flow_id_missmatch(); + flow_id_mismatch(); } } } @@ -281,7 +281,7 @@ impl VerificationMachine { self.mark_sas_as_done(s, content).await?; } } else { - flow_id_missmatch(); + flow_id_mismatch(); } } } diff --git a/matrix_sdk_crypto/src/verification/requests.rs b/matrix_sdk_crypto/src/verification/requests.rs index 77556ca9..3a2370fd 100644 --- a/matrix_sdk_crypto/src/verification/requests.rs +++ b/matrix_sdk_crypto/src/verification/requests.rs @@ -484,7 +484,7 @@ impl RequestState { flow_id: &FlowId, content: &RequestContent, ) -> RequestState { - // TODO only create this if we suport the methods + // TODO only create this if we support the methods RequestState { account, private_cross_signing_identity: private_identity, @@ -617,7 +617,7 @@ impl RequestState { } }, m => { - warn!(method =? m, "Received a key verificaton start event with an unsupported method") + warn!(method =? m, "Received a key verification start event with an unsupported method") } } diff --git a/matrix_sdk_crypto/src/verification/sas/sas_state.rs b/matrix_sdk_crypto/src/verification/sas/sas_state.rs index 07d0b2d2..78200f52 100644 --- a/matrix_sdk_crypto/src/verification/sas/sas_state.rs +++ b/matrix_sdk_crypto/src/verification/sas/sas_state.rs @@ -274,7 +274,7 @@ pub struct MacReceived { /// The SAS state we're going to be in after we receive a MAC event in a DM. DMs /// require a final message `m.key.verification.done` message to conclude the -/// verificaton. This state waits for such a message. +/// verification. This state waits for such a message. #[derive(Clone, Debug)] pub struct WaitingForDone { verified_devices: Arc<[ReadOnlyDevice]>, From f36fb55727a8add993a7263c393cb7f5f9332f13 Mon Sep 17 00:00:00 2001 From: Jonathan de Jong Date: Sat, 5 Jun 2021 14:50:08 +0200 Subject: [PATCH 2/3] some more typos --- matrix_sdk_crypto/src/olm/account.rs | 8 ++++---- matrix_sdk_crypto/src/olm/mod.rs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/matrix_sdk_crypto/src/olm/account.rs b/matrix_sdk_crypto/src/olm/account.rs index 2208a621..4c659444 100644 --- a/matrix_sdk_crypto/src/olm/account.rs +++ b/matrix_sdk_crypto/src/olm/account.rs @@ -99,7 +99,7 @@ pub struct OlmDecryptionInfo { pub inbound_group_session: Option, } -/// A hash of a succesfully decrypted Olm message. +/// A hash of a successfully decrypted Olm message. /// /// Can be used to check if a message has been replayed to us. #[derive(Debug, Clone, Serialize, Deserialize)] @@ -378,11 +378,11 @@ impl Account { // TODO make the errors a bit more specific. let decrypted_json: Value = serde_json::from_str(&plaintext)?; - let encrytped_sender = decrypted_json + let encrypted_sender = decrypted_json .get("sender") .cloned() .ok_or_else(|| EventError::MissingField("sender".to_string()))?; - let encrytped_sender: UserId = serde_json::from_value(encrytped_sender)?; + let encrypted_sender: UserId = serde_json::from_value(encrypted_sender)?; let recipient = decrypted_json .get("recipient") .cloned() @@ -402,7 +402,7 @@ impl Account { .ok_or_else(|| EventError::MissingField("keys".to_string()))?, )?; - if &recipient != self.user_id() || sender != &encrytped_sender { + if &recipient != self.user_id() || sender != &encrypted_sender { return Err(EventError::MissmatchedSender.into()); } diff --git a/matrix_sdk_crypto/src/olm/mod.rs b/matrix_sdk_crypto/src/olm/mod.rs index 933a3969..42ba3ef2 100644 --- a/matrix_sdk_crypto/src/olm/mod.rs +++ b/matrix_sdk_crypto/src/olm/mod.rs @@ -53,7 +53,7 @@ where let now = Instant::now(); let instant = now .checked_sub(duration) - .ok_or_else(|| serde::de::Error::custom("Can't substract the the current instant"))?; + .ok_or_else(|| serde::de::Error::custom("Can't subtract the the current instant"))?; Ok(instant) } From f76cb1d123017defe709983af60ba1bac1ff81fd Mon Sep 17 00:00:00 2001 From: Jonathan de Jong Date: Sat, 5 Jun 2021 14:55:01 +0200 Subject: [PATCH 3/3] the the --- matrix_sdk_crypto/src/file_encryption/attachments.rs | 2 +- matrix_sdk_crypto/src/olm/mod.rs | 2 +- matrix_sdk_crypto/src/store/caches.rs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/matrix_sdk_crypto/src/file_encryption/attachments.rs b/matrix_sdk_crypto/src/file_encryption/attachments.rs index 70354f1f..d20392c8 100644 --- a/matrix_sdk_crypto/src/file_encryption/attachments.rs +++ b/matrix_sdk_crypto/src/file_encryption/attachments.rs @@ -197,7 +197,7 @@ impl<'a, R: Read + 'a> AttachmentEncryptor<'a, R> { let mut iv = Zeroizing::new([0u8; IV_SIZE]); getrandom(&mut *key).expect("Can't generate randomness"); - // Only populate the the first 8 bits with randomness, the rest is 0 + // Only populate the first 8 bits with randomness, the rest is 0 // initialized. getrandom(&mut iv[0..8]).expect("Can't generate randomness"); diff --git a/matrix_sdk_crypto/src/olm/mod.rs b/matrix_sdk_crypto/src/olm/mod.rs index 42ba3ef2..51f81fd3 100644 --- a/matrix_sdk_crypto/src/olm/mod.rs +++ b/matrix_sdk_crypto/src/olm/mod.rs @@ -53,7 +53,7 @@ where let now = Instant::now(); let instant = now .checked_sub(duration) - .ok_or_else(|| serde::de::Error::custom("Can't subtract the the current instant"))?; + .ok_or_else(|| serde::de::Error::custom("Can't subtract the current instant"))?; Ok(instant) } diff --git a/matrix_sdk_crypto/src/store/caches.rs b/matrix_sdk_crypto/src/store/caches.rs index a8f2e2c4..0fba1cfa 100644 --- a/matrix_sdk_crypto/src/store/caches.rs +++ b/matrix_sdk_crypto/src/store/caches.rs @@ -44,7 +44,7 @@ impl SessionStore { /// Add a session to the store. /// - /// Returns true if the the session was added, false if the session was + /// Returns true if the session was added, false if the session was /// already in the store. pub async fn add(&self, session: Session) -> bool { let sessions_lock = self @@ -89,7 +89,7 @@ impl GroupSessionStore { /// Add an inbound group session to the store. /// - /// Returns true if the the session was added, false if the session was + /// Returns true if the session was added, false if the session was /// already in the store. pub fn add(&self, session: InboundGroupSession) -> bool { self.entries