From af8870aaae04eb4641b8b0cac7fad5b48686e139 Mon Sep 17 00:00:00 2001 From: Joonas Koivunen Date: Wed, 19 Aug 2020 20:24:11 +0300 Subject: [PATCH] refactor: remove commented out code --- http/src/v0/refs/path.rs | 37 ------------------------------------- 1 file changed, 37 deletions(-) diff --git a/http/src/v0/refs/path.rs b/http/src/v0/refs/path.rs index 271359cc..60c0a824 100644 --- a/http/src/v0/refs/path.rs +++ b/http/src/v0/refs/path.rs @@ -120,16 +120,6 @@ impl IpfsPath { self.follow_dagpb_data } - /* - pub fn resolve(&mut self, ipld: Ipld) -> Result { - let key = match self.next() { - Some(key) => key, - None => return Ok(WalkSuccess::EmptyPath(ipld)), - }; - - Self::resolve_segment(key, ipld) - }*/ - pub fn resolve_segment(key: &str, mut ipld: Ipld) -> Result { ipld = match ipld { Ipld::Link(cid) if key == "." => { @@ -165,33 +155,6 @@ impl IpfsPath { } } - /* - /// Walks the path depicted by self until either the path runs out or a new link needs to be - /// traversed to continue the walk. With !dag-pb documents this can result in subtree of an - /// Ipld be represented. - /// - /// # Panics - /// - /// If the current Ipld is from a dag-pb and the libipld has changed it's dag-pb tree structure. - // FIXME: this needs to be removed and ... we should have some generic Ipld::walk - pub fn walk(&mut self, current: &Cid, mut ipld: Ipld) -> Result { - if self.len() == 0 { - return Ok(WalkSuccess::EmptyPath(ipld)); - } - if current.codec() == cid::Codec::DagProtobuf { - return Err(WalkFailed::UnsupportedWalkOnDagPbIpld); - } - - loop { - ipld = match self.resolve(ipld)? { - WalkSuccess::AtDestination(ipld) => ipld, - WalkSuccess::EmptyPath(ipld) => return Ok(WalkSuccess::AtDestination(ipld)), - ret @ WalkSuccess::Link(_, _) => return Ok(ret), - }; - } - } - */ - pub fn remaining_path(&self) -> &[String] { self.path.as_slice() }