summaryrefslogtreecommitdiffstats
path: root/src/types/encodable_cid.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/types/encodable_cid.rs')
-rw-r--r--src/types/encodable_cid.rs28
1 files changed, 0 insertions, 28 deletions
diff --git a/src/types/encodable_cid.rs b/src/types/encodable_cid.rs
deleted file mode 100644
index 014d661..0000000
--- a/src/types/encodable_cid.rs
+++ /dev/null
@@ -1,28 +0,0 @@
-use std::collections::HashMap;
-
-/// An DAG-JSON encodable cid
-///
-/// this is a hack. DAG-JSON expects a linked CID to be of the form
-///
-/// "/": "<cid hash>"
-///
-/// (see https://ipld.io/docs/codecs/known/dag-json/)
-///
-/// so we have a wrapper type here to make the CID encodable
-#[derive(Clone, Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
-pub struct EncodableCid(HashMap<String, crate::cid::Cid>);
-
-impl From<crate::cid::Cid> for EncodableCid {
- fn from(cid: crate::cid::Cid) -> Self {
- let mut hm = HashMap::new();
- hm.insert(String::from("/"), cid);
- Self(hm)
- }
-}
-
-impl Into<crate::cid::Cid> for EncodableCid {
- fn into(self) -> crate::cid::Cid {
- self.0.get("/").unwrap().clone()
- }
-}
-