From 582fcf863328840a09ff9ede919043ae266a2f87 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 10 Nov 2022 16:33:06 -0800 Subject: cli: serializable DID --- adenosine-cli/Cargo.toml | 3 ++- adenosine-cli/src/identifiers.rs | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/adenosine-cli/Cargo.toml b/adenosine-cli/Cargo.toml index 55ac268..3128b49 100644 --- a/adenosine-cli/Cargo.toml +++ b/adenosine-cli/Cargo.toml @@ -18,7 +18,8 @@ repository = "https://gitlab.com/bnewbold/adenosine" structopt = "*" # NOTE: could try 'rustls-tls' feature instead of default native TLS? reqwest = { version = "0.11", features = ["blocking", "json"] } -serde_json = "*" +serde = "1" +serde_json = "1" base64 = "*" regex = "*" lazy_static = "*" diff --git a/adenosine-cli/src/identifiers.rs b/adenosine-cli/src/identifiers.rs index ed9c0fd..a6a2696 100644 --- a/adenosine-cli/src/identifiers.rs +++ b/adenosine-cli/src/identifiers.rs @@ -152,7 +152,7 @@ fn test_aturi() { } /// A String (newtype) representing an NSID -#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, serde::Serialize)] pub struct Nsid(String); impl FromStr for Nsid { @@ -205,7 +205,7 @@ fn test_nsid() { assert_eq!(nsid.domain(), "atproto.com".to_string()); } -#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, serde::Serialize)] pub struct Did(String); impl FromStr for Did { -- cgit v1.2.3