From c2b458323f9f37c8134e94256713da174eabf844 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Mon, 23 Dec 2024 09:44:02 +0000 Subject: [PATCH] feat: impl From for TrelloCardPosition --- src/trello/model/card.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/trello/model/card.rs b/src/trello/model/card.rs index 41502b9..818c209 100644 --- a/src/trello/model/card.rs +++ b/src/trello/model/card.rs @@ -1,5 +1,6 @@ // use derive_more::derive::Display; +use derive_more::From; use serde::{Deserialize, Deserializer}; use super::attachment::TrelloAttachment; @@ -13,6 +14,11 @@ newtype!(TrelloCardDue, String, Display, "Card Due"); #[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Display)] pub(crate) struct TrelloCardPosition(pub i64); +impl From for TrelloCardPosition { + fn from(value: i64) -> Self { + Self(value) + } +} impl<'de> Deserialize<'de> for TrelloCardPosition { fn deserialize(deserializer: D) -> Result