From c36b4944a9d128bff65ad4ae130f93739714ff60 Mon Sep 17 00:00:00 2001 From: Lucas Date: Sun, 10 Nov 2024 15:17:44 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Derive=20`S?= =?UTF-8?q?erialize`=20for=20`JournalEvent`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit semver: chore --- src/modules/journal/models/journal_event.rs | 3 ++- src/modules/journal/models/journal_event_kind.rs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/modules/journal/models/journal_event.rs b/src/modules/journal/models/journal_event.rs index db7c2484..392e6153 100644 --- a/src/modules/journal/models/journal_event.rs +++ b/src/modules/journal/models/journal_event.rs @@ -1,6 +1,7 @@ use crate::journal::JournalEventKind; +use serde::Serialize; -#[derive(Debug, Clone)] +#[derive(Debug, Clone, Serialize)] pub struct JournalEvent { /// Indicates whether the event was fired from a change in the journal directory or whether /// it's an event from a log file other than the current one. diff --git a/src/modules/journal/models/journal_event_kind.rs b/src/modules/journal/models/journal_event_kind.rs index 2ec87f06..b28be772 100644 --- a/src/modules/journal/models/journal_event_kind.rs +++ b/src/modules/journal/models/journal_event_kind.rs @@ -8,10 +8,11 @@ use crate::nav_route::NavRoute; use crate::ship_locker::ShipLocker; use crate::shipyard::Shipyard; use crate::status::Status; +use serde::Serialize; /// This event is fired from the [LiveJournalDirReader] when any change happens in the journal /// directory and includes all the possible models that could have been updated. -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Serialize)] // The large enum variant is allowed here as this is usually allocated by the reader anyway and // adding another box here wouldn't be that useful. Also even though it's large, it's not huge. #[allow(clippy::large_enum_variant)]