From 85037832d17241c779cfdc34a794c0988633fc30 Mon Sep 17 00:00:00 2001 From: Amanda Graven Date: Mon, 18 Jan 2021 16:12:28 +0100 Subject: [PATCH] Minor comment spelling and formatting fixes --- ruma-api/src/lib.rs | 2 +- ruma-events/src/call/answer.rs | 2 +- ruma-events/src/call/invite.rs | 2 +- ruma-events/src/lib.rs | 8 ++++---- ruma-events/src/presence.rs | 2 +- ruma-events/src/room.rs | 2 +- ruma-events/src/room/power_levels.rs | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ruma-api/src/lib.rs b/ruma-api/src/lib.rs index fa49c3a7..44c7e1ef 100644 --- a/ruma-api/src/lib.rs +++ b/ruma-api/src/lib.rs @@ -67,7 +67,7 @@ use http::Method; /// * `name`: A unique name for the endpoint. Generally this will be the same as the containing /// module. /// * `path`: The path component of the URL for the endpoint, e.g. "/foo/bar". Components of -/// the path that are parameterized can indicate a varible by using a Rust identifier +/// the path that are parameterized can indicate a variable by using a Rust identifier /// prefixed with a colon, e.g. `/foo/:some_parameter`. A corresponding query string /// parameter will be expected in the request struct (see below for details). /// * `rate_limited`: Whether or not the endpoint enforces rate limiting on requests. diff --git a/ruma-events/src/call/answer.rs b/ruma-events/src/call/answer.rs index 930835e4..1fb8080c 100644 --- a/ruma-events/src/call/answer.rs +++ b/ruma-events/src/call/answer.rs @@ -26,7 +26,7 @@ pub struct AnswerEventContent { } impl AnswerEventContent { - /// Creates an `AnswerEventContent` with the gieven answer, call ID and VoIP version. + /// Creates an `AnswerEventContent` with the given answer, call ID and VoIP version. pub fn new(answer: SessionDescription, call_id: String, version: UInt) -> Self { Self { answer, call_id, version } } diff --git a/ruma-events/src/call/invite.rs b/ruma-events/src/call/invite.rs index 48f9157b..c324e0c4 100644 --- a/ruma-events/src/call/invite.rs +++ b/ruma-events/src/call/invite.rs @@ -14,7 +14,7 @@ pub type InviteEvent = MessageEvent; #[derive(Clone, Debug, Deserialize, Serialize, MessageEventContent)] #[ruma_event(type = "m.call.invite")] pub struct InviteEventContent { - /// A unique identifer for the call. + /// A unique identifier for the call. pub call_id: String, /// The time in milliseconds that the invite is valid for. Once the invite age exceeds this diff --git a/ruma-events/src/lib.rs b/ruma-events/src/lib.rs index b90ab8c6..32681944 100644 --- a/ruma-events/src/lib.rs +++ b/ruma-events/src/lib.rs @@ -162,7 +162,7 @@ //! The collection types are enums which effectively "wrap" each possible event type of a //! particular event "kind." //! -//! Because of the hierarchical nature of event kinds in Matrix, these collection types are divied +//! Because of the hierarchical nature of event kinds in Matrix, these collection types are divided //! into two modules, `ruma_events::collections::all` and `ruma_events::collections::only`. //! The "all" versions include every event type that implements the relevant event trait as well as //! more specific event traits. @@ -497,7 +497,7 @@ pub struct UnsignedDeHelper { pub redacted_because: Option, } -/// Helper struct to determine the event kind from a serde_json::value::RawValue. +/// Helper struct to determine the event kind from a `serde_json::value::RawValue`. #[doc(hidden)] #[derive(Debug, Deserialize)] pub struct EventDeHelper { @@ -516,12 +516,12 @@ pub struct EventDeHelper { /// the event will be deserialized as a ephemeral event. pub room_id: Option, - /// If this `UnsignedData` contains a redacted_because key the event is + /// If this `UnsignedData` contains a `redacted_because` key the event is /// immediately deserialized as a redacted event. pub unsigned: Option, } -/// Helper function for serde_json::value::RawValue deserialization. +/// Helper function for `serde_json::value::RawValue` deserialization. #[doc(hidden)] pub fn from_raw_json_value(val: &RawJsonValue) -> Result where diff --git a/ruma-events/src/presence.rs b/ruma-events/src/presence.rs index 0f89792e..1264675f 100644 --- a/ruma-events/src/presence.rs +++ b/ruma-events/src/presence.rs @@ -1,6 +1,6 @@ //! A presence event is represented by a struct with a set content field. //! -//! The only content valid for this event is `PresenceEventContent. +//! The only content valid for this event is `PresenceEventContent`. use js_int::UInt; use ruma_common::presence::PresenceState; diff --git a/ruma-events/src/room.rs b/ruma-events/src/room.rs index 9331988b..1347af17 100644 --- a/ruma-events/src/room.rs +++ b/ruma-events/src/room.rs @@ -121,7 +121,7 @@ pub struct JsonWebKey { /// Required. Algorithm. Must be `A256CTR`. pub alg: String, - /// The key, encoded as urlsafe unpadded base64. + /// The key, encoded as url-safe unpadded base64. pub k: String, /// Extractable. Must be `true`. This is a diff --git a/ruma-events/src/room/power_levels.rs b/ruma-events/src/room/power_levels.rs index 3fe22c93..22a3ce2e 100644 --- a/ruma-events/src/room/power_levels.rs +++ b/ruma-events/src/room/power_levels.rs @@ -149,7 +149,7 @@ fn default_power_level() -> Int { Int::from(50) } -/// Used with #[serde(skip_serializing_if)] to omit default power levels. +/// Used with `#[serde(skip_serializing_if)]` to omit default power levels. #[allow(clippy::trivially_copy_pass_by_ref)] fn is_default_power_level(l: &Int) -> bool { *l == Int::from(50)