Skip to content

Commit 359eb3c

Browse files
poljarrichvdh
andcommitted
doc(crypto): Improve the documentation for the encrypted Content serialization
Co-authored-by: Richard van der Hoff <[email protected]> Signed-off-by: Damir Jelić <[email protected]>
1 parent 64f54e5 commit 359eb3c

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

crates/matrix-sdk-crypto/src/olm/session.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,12 +157,15 @@ impl Session {
157157
}
158158

159159
impl EventType for Content<'_> {
160-
// This is a bit of a hack, usually we just define the `EVENT_TYPE` and use the
161-
// default implementation of `event_type()`, we can't do this here
160+
// This is a bit of a hack: usually we just define the `EVENT_TYPE` and use the
161+
// default implementation of `event_type()`. We can't do this here
162162
// because the event type isn't static.
163163
//
164-
// So we just leave EVENT_TYPE out. This works because the serialization is
165-
// using `event_type()` and this type is contained to this function.
164+
// We have to provide `EVENT_TYPE` to conform to the `EventType` trait, but
165+
// don't actually use it, so we just leave it empty.
166+
//
167+
// This works because the serialization uses `event_type()` and this type is
168+
// contained to this function.
166169
const EVENT_TYPE: &'static str = "";
167170

168171
fn event_type(&self) -> &str {

crates/matrix-sdk-crypto/src/types/events/olm_v1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ impl AnyDecryptedOlmEvent {
163163

164164
/// An `m.olm.v1.curve25519-aes-sha2` decrypted to-device event.
165165
///
166-
/// **Note**: This event will reserialize events lossy, unknown fields will be
166+
/// **Note**: This event will reserialize events lossily; unknown fields will be
167167
/// lost during deserialization.
168168
#[derive(Clone, Debug, Deserialize)]
169169
pub struct DecryptedOlmV1Event<C>

0 commit comments

Comments
 (0)