This repository was archived by the owner on Oct 23, 2022. It is now read-only.
File tree 8 files changed +12
-12
lines changed 8 files changed +12
-12
lines changed Original file line number Diff line number Diff line change 1
1
use crate :: { Error , Ipfs , IpfsTypes } ;
2
2
use async_stream:: stream;
3
3
use cid:: Cid ;
4
+ use core:: fmt;
5
+ use core:: ops:: Range ;
4
6
use futures:: stream:: Stream ;
5
7
use ipfs_unixfs:: file:: { visit:: IdleFileVisit , FileReadFailed } ;
6
8
use std:: borrow:: Borrow ;
7
- use core:: fmt;
8
- use core:: ops:: Range ;
9
9
10
10
/// IPFS cat operation, producing a stream of file bytes. This is generic over the different kinds
11
11
/// of ways to own an `Ipfs` value in order to support both operating with borrowed `Ipfs` value
Original file line number Diff line number Diff line change 1
1
use cid:: Cid ;
2
- use ipfs_unixfs:: file:: adder:: FileAdder ;
3
2
use core:: fmt;
4
- use std:: io:: { BufRead , BufReader } ;
5
3
use core:: time:: Duration ;
4
+ use ipfs_unixfs:: file:: adder:: FileAdder ;
5
+ use std:: io:: { BufRead , BufReader } ;
6
6
7
7
fn main ( ) {
8
8
// read stdin, maybe produce stdout car?
Original file line number Diff line number Diff line change 1
1
use cid:: Cid ;
2
- use ipfs_unixfs:: file:: { visit:: IdleFileVisit , FileReadFailed } ;
3
2
use core:: convert:: TryFrom ;
4
3
use core:: fmt;
4
+ use ipfs_unixfs:: file:: { visit:: IdleFileVisit , FileReadFailed } ;
5
5
use std:: io:: { Error as IoError , Read , Write } ;
6
6
use std:: path:: PathBuf ;
7
7
Original file line number Diff line number Diff line change 1
1
///! dag-pb support operations. Placing this module inside unixfs module is a bit unfortunate but
2
2
///! follows from the inseparability of dag-pb and UnixFS.
3
3
use crate :: pb:: PBNode ;
4
- use std:: borrow:: Cow ;
5
4
use core:: convert:: TryFrom ;
5
+ use std:: borrow:: Cow ;
6
6
7
7
/// Extracts the PBNode::Data field from the block as it appears on the block.
8
8
pub fn node_data ( block : & [ u8 ] ) -> Result < Option < & [ u8 ] > , quick_protobuf:: Error > {
Original file line number Diff line number Diff line change @@ -216,8 +216,8 @@ mod tests {
216
216
use super :: { resolve, MaybeResolved } ;
217
217
use crate :: test_support:: FakeBlockstore ;
218
218
use cid:: Cid ;
219
- use hex_literal:: hex;
220
219
use core:: convert:: TryFrom ;
220
+ use hex_literal:: hex;
221
221
222
222
#[ test]
223
223
fn resolve_paths_from_plain_dagpb ( ) {
Original file line number Diff line number Diff line change 4
4
///! [`ipfs_unixfs::walk::Walker`] should typically be used for accessing file content.
5
5
use crate :: pb:: ParsingFailed ;
6
6
use crate :: { InvalidCidInLink , Metadata , UnexpectedNodeType } ;
7
- use std:: borrow:: Cow ;
8
7
use core:: fmt;
8
+ use std:: borrow:: Cow ;
9
9
10
10
/// Low level UnixFS file descriptor reader support.
11
11
mod reader;
Original file line number Diff line number Diff line change 8
8
//! `ipfs_unixfs::walk::Walker`. To resolve `IpfsPath` segments over dag-pb nodes,
9
9
//! `ipfs_unixfs::resolve` should be used.
10
10
11
- use std:: borrow:: Cow ;
12
11
use core:: fmt;
12
+ use std:: borrow:: Cow ;
13
13
14
14
/// File support.
15
15
pub mod file;
Original file line number Diff line number Diff line change 1
- use quick_protobuf:: { errors:: Result as ProtobufResult , Writer , WriterBackend } ;
2
- use std:: borrow:: Cow ;
3
1
use core:: convert:: TryFrom ;
4
2
use core:: fmt;
5
3
use core:: ops:: Range ;
4
+ use quick_protobuf:: { errors:: Result as ProtobufResult , Writer , WriterBackend } ;
5
+ use std:: borrow:: Cow ;
6
6
7
7
pub ( crate ) mod merkledag;
8
8
pub ( crate ) use merkledag:: PBLink ;
@@ -200,9 +200,9 @@ where
200
200
mod test {
201
201
202
202
use super :: { FlatUnixFs , PBNode , UnixFs , UnixFsType } ;
203
+ use core:: convert:: TryFrom ;
203
204
use hex_literal:: hex;
204
205
use std:: borrow:: Cow ;
205
- use core:: convert:: TryFrom ;
206
206
207
207
#[ test]
208
208
fn parse_content ( ) {
You can’t perform that action at this time.
0 commit comments