events: Clean up some comments

This commit is contained in:
Jonas Platte 2021-04-13 12:35:25 +02:00
parent 58b8797961
commit 499c615f55
No known key found for this signature in database
GPG Key ID: CC154DE0E30B7C67
2 changed files with 8 additions and 9 deletions

View File

@ -210,7 +210,7 @@ impl From<MessageType> for MessageEventContent {
} }
/// Enum modeling the different ways relationships can be expressed in a /// Enum modeling the different ways relationships can be expressed in a
/// `m.relates_to` field of an m.room.message event. /// `m.relates_to` field of an `m.room.message` event.
#[derive(Clone, Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(from = "RelatesToJsonRepr", into = "RelatesToJsonRepr")] #[serde(from = "RelatesToJsonRepr", into = "RelatesToJsonRepr")]
pub enum Relation { pub enum Relation {

View File

@ -1,7 +1,7 @@
//! Types for event relationships. //! Types for event relationships.
//! //!
//! Events in Matrix can relate to one another in a couple of ways, this module //! Events in Matrix can relate to one another in a couple of ways, this module adds types to parse
//! adds types to parse the relationship of an event if any exists. //! the relationship of an event if any exists.
//! //!
//! MSC for all the relates_to types except replies: //! MSC for all the relates_to types except replies:
//! <https://github.com/matrix-org/matrix-doc/pull/2674> //! <https://github.com/matrix-org/matrix-doc/pull/2674>
@ -10,18 +10,17 @@ use ruma_identifiers::EventId;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use serde_json::Value as JsonValue; use serde_json::Value as JsonValue;
/// Enum modeling the different ways relationships can be expressed in a /// Enum modeling the different ways relationships can be expressed in a `m.relates_to` field of an
/// `m.relates_to` field of an event. /// event.
#[derive(Clone, Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(untagged)] #[serde(untagged)]
pub(crate) enum RelatesToJsonRepr { pub(crate) enum RelatesToJsonRepr {
/// A relation which contains subtypes indicating the type of the /// A relation which contains subtypes indicating the type of the relationship with the
/// relationship with the `rel_type` field. /// `rel_type` field.
#[cfg(feature = "unstable-pre-spec")] #[cfg(feature = "unstable-pre-spec")]
Relation(RelationJsonRepr), Relation(RelationJsonRepr),
/// An `m.in_reply_to` relationship indicating that the event is a reply to /// An `m.in_reply_to` relationship indicating that the event is a reply to another event.
/// another event.
Reply { Reply {
/// Information about another message being replied to. /// Information about another message being replied to.
#[serde(rename = "m.in_reply_to")] #[serde(rename = "m.in_reply_to")]