Skip to content
This repository was archived by the owner on Oct 23, 2022. It is now read-only.

Commit 767f7dd

Browse files
committed
Rustfmt
1 parent 2f39590 commit 767f7dd

File tree

12 files changed

+19
-19
lines changed

12 files changed

+19
-19
lines changed

src/unixfs/cat.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
use crate::{Error, Ipfs, IpfsTypes};
22
use async_stream::stream;
33
use cid::Cid;
4-
use futures::stream::Stream;
5-
use ipfs_unixfs::file::{visit::IdleFileVisit, FileReadFailed};
64
use core::borrow::Borrow;
75
use core::fmt;
86
use core::ops::Range;
7+
use futures::stream::Stream;
8+
use ipfs_unixfs::file::{visit::IdleFileVisit, FileReadFailed};
99

1010
/// IPFS cat operation, producing a stream of file bytes. This is generic over the different kinds
1111
/// of ways to own an `Ipfs` value in order to support both operating with borrowed `Ipfs` value

unixfs/src/dagpb.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
///! dag-pb support operations. Placing this module inside unixfs module is a bit unfortunate but
22
///! follows from the inseparability of dag-pb and UnixFS.
33
use crate::pb::PBNode;
4-
use std::borrow::Cow;
54
use core::convert::TryFrom;
5+
use std::borrow::Cow;
66

77
/// Extracts the PBNode::Data field from the block as it appears on the block.
88
pub fn node_data(block: &[u8]) -> Result<Option<&[u8]>, quick_protobuf::Error> {

unixfs/src/dir.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,8 @@ mod tests {
216216
use super::{resolve, MaybeResolved};
217217
use crate::test_support::FakeBlockstore;
218218
use cid::Cid;
219-
use hex_literal::hex;
220219
use core::convert::TryFrom;
220+
use hex_literal::hex;
221221

222222
#[test]
223223
fn resolve_paths_from_plain_dagpb() {

unixfs/src/dir/builder/iter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ use super::{
22
CustomFlatUnixFs, DirBuilder, Entry, Leaf, NamedLeaf, TreeConstructionFailed, TreeOptions,
33
};
44
use cid::Cid;
5-
use std::collections::HashMap;
65
use core::fmt;
6+
use std::collections::HashMap;
77

88
/// Constructs the directory nodes required for a tree.
99
///

unixfs/src/dir/sharded_lookup.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ use super::{try_convert_cid, MaybeResolved, MultipleMatchingLinks, ResolveError}
22
use crate::pb::{FlatUnixFs, PBLink, ParsingFailed, UnixFsType};
33
use crate::{InvalidCidInLink, UnexpectedNodeType};
44
use cid::Cid;
5-
use std::borrow::Cow;
6-
use std::collections::VecDeque;
75
use core::convert::TryFrom;
86
use core::fmt;
7+
use std::borrow::Cow;
8+
use std::collections::VecDeque;
99

1010
/// A cache of data structures used while traversing. Reduces allocations when walking over multiple
1111
/// path segments.
@@ -337,8 +337,8 @@ impl std::error::Error for LookupError {
337337
mod tests {
338338
use super::{LookupError, MaybeResolved, ShardError, ShardedLookup};
339339
use crate::pb::FlatUnixFs;
340-
use hex_literal::hex;
341340
use core::convert::TryFrom;
341+
use hex_literal::hex;
342342

343343
// a directory from some linux kernel tree import: linux-5.5-rc5/tools/testing/selftests/rcutorture/
344344
const DIR: &[u8] = &hex!("122e0a2212204baf5104fe53d495223f8e2ba95375a31fda6b18e926cb54edd61f30b5f1de6512053641646f6318b535122c0a221220fd9f545068048e647d5d0b275ed171596e0c1c04b8fed09dc13bee7607e75bc7120242391883c00312330a2212208a4a68f6b88594ce373419586c12d24bde2d519ab636b1d2dcc986eb6265b7a3120a43444d616b6566696c65189601122f0a2212201ededc99d23a7ef43a8f17e6dd8b89934993245ef39e18936a37e412e536ed681205463562696e18c5ad030a280805121f200000000020000200000000000000000004000000000000000000000000002822308002");

unixfs/src/file.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
///! [`ipfs_unixfs::walk::Walker`] should typically be used for accessing file content.
55
use crate::pb::ParsingFailed;
66
use crate::{InvalidCidInLink, Metadata, UnexpectedNodeType};
7-
use std::borrow::Cow;
87
use core::fmt;
8+
use std::borrow::Cow;
99

1010
/// Low level UnixFS file descriptor reader support.
1111
mod reader;

unixfs/src/file/adder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
use cid::Cid;
22

33
use crate::pb::{FlatUnixFs, PBLink, UnixFs, UnixFsType};
4+
use core::fmt;
45
use quick_protobuf::{MessageWrite, Writer};
56
use std::borrow::Cow;
6-
use core::fmt;
77

88
use sha2::{Digest, Sha256};
99

@@ -646,8 +646,8 @@ mod tests {
646646
use super::{BalancedCollector, Chunker, FileAdder};
647647
use crate::test_support::FakeBlockstore;
648648
use cid::Cid;
649-
use hex_literal::hex;
650649
use core::convert::TryFrom;
650+
use hex_literal::hex;
651651

652652
#[test]
653653
fn test_size_chunker() {

unixfs/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
//! `ipfs_unixfs::walk::Walker`. To resolve `IpfsPath` segments over dag-pb nodes,
99
//! `ipfs_unixfs::resolve` should be used.
1010
11-
use std::borrow::Cow;
1211
use core::fmt;
12+
use std::borrow::Cow;
1313

1414
/// File support.
1515
pub mod file;

unixfs/src/pb.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
use quick_protobuf::{errors::Result as ProtobufResult, Writer, WriterBackend};
2-
use std::borrow::Cow;
31
use core::convert::TryFrom;
42
use core::fmt;
53
use core::ops::Range;
4+
use quick_protobuf::{errors::Result as ProtobufResult, Writer, WriterBackend};
5+
use std::borrow::Cow;
66

77
pub(crate) mod merkledag;
88
pub(crate) use merkledag::PBLink;
@@ -199,9 +199,9 @@ where
199199
#[cfg(test)]
200200
mod test {
201201
use super::{FlatUnixFs, PBNode, UnixFs, UnixFsType};
202+
use core::convert::TryFrom;
202203
use hex_literal::hex;
203204
use std::borrow::Cow;
204-
use core::convert::TryFrom;
205205

206206
#[test]
207207
fn parse_content() {

unixfs/src/symlink.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ pub fn serialize_symlink_block(target_path: &str, block_buffer: &mut Vec<u8>) {
3333
mod tests {
3434
use super::serialize_symlink_block;
3535
use cid::Cid;
36-
use sha2::{Digest, Sha256};
3736
use core::convert::TryFrom;
37+
use sha2::{Digest, Sha256};
3838

3939
#[test]
4040
fn simple_symlink() {

unixfs/src/test_support.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use cid::Cid;
2+
use core::convert::TryFrom;
23
use hex_literal::hex;
34
use std::collections::HashMap;
4-
use core::convert::TryFrom;
55

66
#[derive(Default)]
77
pub struct FakeBlockstore {

unixfs/src/walk.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ use crate::file::{FileError, FileReadFailed};
44
use crate::pb::{FlatUnixFs, PBLink, ParsingFailed, UnixFsType};
55
use crate::{InvalidCidInLink, Metadata, UnexpectedNodeType};
66
use cid::Cid;
7-
use either::Either;
8-
use std::borrow::Cow;
97
use core::convert::TryFrom;
108
use core::fmt;
9+
use either::Either;
10+
use std::borrow::Cow;
1111
use std::path::{Path, PathBuf};
1212

1313
/// `Walker` helps with walking a UnixFS tree, including all of the content and files. It is

0 commit comments

Comments
 (0)