mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-13 18:45:44 -04:00
timeline: remove redundant Debug implementations
These are no longer required now that the event itself lives in an inner class.
This commit is contained in:
committed by
Richard van der Hoff
parent
d9167f208a
commit
42f0d83b53
@@ -303,7 +303,7 @@ pub struct EncryptionInfo {
|
||||
/// Previously, this differed from [`TimelineEvent`] by wrapping an
|
||||
/// [`AnySyncTimelineEvent`] instead of an [`AnyTimelineEvent`], but nowadays
|
||||
/// they are essentially identical, and one of them should probably be removed.
|
||||
#[derive(Clone, Serialize)]
|
||||
#[derive(Clone, Debug, Serialize)]
|
||||
pub struct SyncTimelineEvent {
|
||||
/// The event itself, together with any information on decryption.
|
||||
pub kind: TimelineEventKind,
|
||||
@@ -364,19 +364,6 @@ impl SyncTimelineEvent {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(tarpaulin_include))]
|
||||
impl fmt::Debug for SyncTimelineEvent {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
let SyncTimelineEvent { kind, push_actions } = self;
|
||||
let mut s = f.debug_struct("SyncTimelineEvent");
|
||||
s.field("kind", &kind);
|
||||
if !push_actions.is_empty() {
|
||||
s.field("push_actions", push_actions);
|
||||
}
|
||||
s.finish()
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Raw<AnySyncTimelineEvent>> for SyncTimelineEvent {
|
||||
fn from(inner: Raw<AnySyncTimelineEvent>) -> Self {
|
||||
Self::new(inner)
|
||||
@@ -448,7 +435,7 @@ impl<'de> Deserialize<'de> for SyncTimelineEvent {
|
||||
/// Previously, this differed from [`SyncTimelineEvent`] by wrapping an
|
||||
/// [`AnyTimelineEvent`] instead of an [`AnySyncTimelineEvent`], but nowadays
|
||||
/// they are essentially identical, and one of them should probably be removed.
|
||||
#[derive(Clone)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct TimelineEvent {
|
||||
/// The event itself, together with any information on decryption.
|
||||
pub kind: TimelineEventKind,
|
||||
@@ -499,21 +486,6 @@ impl From<DecryptedRoomEvent> for TimelineEvent {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(tarpaulin_include))]
|
||||
impl fmt::Debug for TimelineEvent {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
let TimelineEvent { kind, push_actions } = self;
|
||||
let mut s = f.debug_struct("TimelineEvent");
|
||||
s.field("kind", &kind);
|
||||
if let Some(push_actions) = &push_actions {
|
||||
if !push_actions.is_empty() {
|
||||
s.field("push_actions", push_actions);
|
||||
}
|
||||
}
|
||||
s.finish()
|
||||
}
|
||||
}
|
||||
|
||||
/// The event within a [`TimelineEvent`] or [`SyncTimelineEvent`], together with
|
||||
/// encryption data.
|
||||
#[derive(Clone, Serialize, Deserialize)]
|
||||
|
||||
Reference in New Issue
Block a user