Skip to content

Commit

Permalink
Merge pull request #500 from Stremio/feat/derive-eq
Browse files Browse the repository at this point in the history
feat: derive(Eq) for Ctx, Error, RuntimeEvent and Event
  • Loading branch information
elpiel authored Sep 11, 2023
2 parents d1a6b71 + cb22e2e commit e523982
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/models/ctx/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use serde::ser::{SerializeStruct, Serializer};
use serde::Serialize;

// TODO move this to runtime::msg::Error and rename it
#[derive(Clone, PartialEq, Serialize, Debug)]
#[derive(Clone, PartialEq, Eq, Serialize, Debug)]
#[serde(tag = "type")]
pub enum CtxError {
API(APIError),
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use url::Url;

pub use conditional_types::{ConditionalSend, EnvFuture, EnvFutureExt};

#[derive(Clone, PartialEq, Debug)]
#[derive(Clone, PartialEq, Eq, Debug)]
pub enum EnvError {
Fetch(String),
AddonTransport(String),
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/msg/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use url::Url;
/// Those messages are meant to be dispatched by the `stremio-core` crate and
/// handled by the users of the `stremio-core` crate and by the `stremio-core`
/// crate itself.
#[derive(Clone, Serialize, Debug, PartialEq)]
#[derive(Clone, Serialize, Debug, PartialEq, Eq)]
#[serde(tag = "event", content = "args")]
pub enum Event {
PlayerPlaying {
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use serde::Serialize;
use std::marker::PhantomData;
use std::sync::{Arc, LockResult, RwLock, RwLockReadGuard};

#[derive(Serialize, Debug, PartialEq)]
#[derive(Serialize, Debug, PartialEq, Eq)]
#[serde(tag = "name", content = "args")]
pub enum RuntimeEvent<E: Env, M: Model<E>> {
NewState(Vec<M::Field>, #[cfg(test)] M),
Expand Down

0 comments on commit e523982

Please sign in to comment.