From: Jochen Sprickerhof <git@jochen.sprickerhof.de>
Date: Mon, 28 Aug 2023 09:31:17 +0200
Subject: Update to new rust-unixfs and cid version

---
 Cargo.toml      | 4 ++--
 src/bin/main.rs | 4 ++--
 src/lib.rs      | 5 ++---
 3 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/Cargo.toml b/Cargo.toml
index ee388f6..f0ef455 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -25,8 +25,8 @@ default = ["console_error_panic_hook"]
 
 [dependencies]
 wasm-bindgen = "0.2.63"
-cid = "^0.5.1"
-ipfs-unixfs = "0.2.0"
+cid = "0.10.1"
+rust-unixfs = "0.4.0"
 libc = "^0.2.73"
 
 
diff --git a/src/bin/main.rs b/src/bin/main.rs
index 176c021..a3086fe 100644
--- a/src/bin/main.rs
+++ b/src/bin/main.rs
@@ -8,7 +8,7 @@
 //! ```
 
 use cid::Cid;
-use ipfs_unixfs::file::adder::FileAdder;
+use rust_unixfs::file::adder::FileAdder;
 
 use std::error::Error;
 use std::fmt;
@@ -123,7 +123,7 @@ struct Stats {
 impl fmt::Display for Stats {
     fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
         let cidv0 = self.last.as_ref().unwrap();
-        let cidv1 = Cid::new_v1(cid::Codec::DagProtobuf, cidv0.hash().to_owned());
+        let cidv1 = cidv0.into_v1().unwrap();
         write!(
             fmt,
             "{{\"CIDv0\":\"{}\",\"CIDv1\":\"{}\"}}",
diff --git a/src/lib.rs b/src/lib.rs
index 0bfce24..c60f0e7 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -7,7 +7,7 @@
 //! Node App adapted from [this `wasm-pack` template](https://github.com/rustwasm/create-wasm-app)
 
 use cid::Cid;
-use ipfs_unixfs::file::adder::FileAdder;
+use rust_unixfs::file::adder::FileAdder;
 
 use wasm_bindgen::prelude::*;
 
@@ -43,7 +43,6 @@ struct Stats {
     last: Option<Cid>,
 }
 
-
 impl Stats {
     fn process<I: Iterator<Item = (Cid, Vec<u8>)>>(&mut self, new_blocks: I) {
         for (cid, _) in new_blocks {
@@ -53,7 +52,7 @@ impl Stats {
 
     fn get_json_cids(&self) -> String {
         let cidv0 = self.last.as_ref().unwrap();
-        let cidv1 = Cid::new_v1(cid::Codec::DagProtobuf, cidv0.hash().to_owned());
+        let cidv1 = cidv0.into_v1().unwrap();
 
         String::from(format!("{{\"CIDv0\":\"{}\",\"CIDv1\":\"{}\"}}",cidv0,cidv1))
     }
