lib_item: remove Ord/PartialOrd implementations, they are not needed
@@ -3,23 +3,15 @@ use chrono::serde::ts_milliseconds;
use chrono::{DateTime, Utc};
use serde::de::IntoDeserializer;
use serde::{Deserialize, Serialize};
-use std::cmp::Ordering;
// Reference: https://github.com/Stremio/stremio-api/blob/master/types/libraryItem.go
-#[derive(Debug, Deserialize, Eq, PartialEq, Ord)]
+#[derive(Debug, Deserialize, Eq, PartialEq)]
pub struct LibItemModified(
pub String,
#[serde(with = "ts_milliseconds")] pub DateTime<Utc>,
);
-impl PartialOrd for LibItemModified {
- fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
- Some(self.1.cmp(&other.1))
- }
-}
-
-// @TODO: u64 vs u32
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, Ord, PartialOrd)]
#[serde(rename_all = "camelCase")]
pub struct LibItemState {
@@ -42,7 +34,7 @@ pub struct LibItemState {
pub no_notif: bool,
}
-#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, Ord)]
+#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
pub struct LibItem {
#[serde(rename = "_id")]
pub id: String,
@@ -88,12 +80,6 @@ impl LibItem {
}
}
-impl PartialOrd for LibItem {
- fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
- Some(self.mtime.cmp(&other.mtime))
- }
-}
-
fn empty_string_as_none<'de, D, T>(de: D) -> Result<Option<T>, D::Error>
where
D: serde::Deserializer<'de>,
