From b1f635aa6ed6cac647f3ae8e297f2d1070ca228c Mon Sep 17 00:00:00 2001 From: Joonas Koivunen Date: Thu, 11 Jun 2020 13:49:17 +0300 Subject: [PATCH] chore: cargo fmt again --- unixfs/src/dagpb.rs | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/unixfs/src/dagpb.rs b/unixfs/src/dagpb.rs index 180bddeb..0da69404 100644 --- a/unixfs/src/dagpb.rs +++ b/unixfs/src/dagpb.rs @@ -1,11 +1,10 @@ -///! dag-pb support operations. Placing this module inside unixfs module is a bit unfortunate but -///! follows from the inseparability of dag-pb and UnixFS. - -use std::convert::TryFrom; -use std::borrow::Cow; -use cid::Cid; use crate::pb::PBNode; use crate::InvalidCidInLink; +use cid::Cid; +use std::borrow::Cow; +///! dag-pb support operations. Placing this module inside unixfs module is a bit unfortunate but +///! follows from the inseparability of dag-pb and UnixFS. +use std::convert::TryFrom; /// Extracts the PBNode::Data field from the block as it appears on the block. pub fn node_data(block: &[u8]) -> Result, quick_protobuf::Error> { @@ -18,10 +17,14 @@ pub fn node_data(block: &[u8]) -> Result, quick_protobuf::Error> { } /// Extracts the PBNode::Links as Cids usable for the ipfs `refs` operation. -pub fn nameless_links(block: &[u8]) -> Result, InvalidCidInLink>, quick_protobuf::Error> { +pub fn nameless_links( + block: &[u8], +) -> Result, InvalidCidInLink>, quick_protobuf::Error> { let doc = PBNode::try_from(block)?; - Ok(doc.Links.into_iter() + Ok(doc + .Links + .into_iter() .enumerate() .map(|(nth, link)| { let hash = link.Hash.as_deref().unwrap_or_default(); @@ -33,5 +36,3 @@ pub fn nameless_links(block: &[u8]) -> Result, InvalidCidInLink> }) .collect::, _>>()) } - -