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

Commit a785c85

Browse files
author
Joonas Koivunen
committed
refactor: use crate level re-export for Block
1 parent e1ef16f commit a785c85

File tree

5 files changed

+7
-10
lines changed

5 files changed

+7
-10
lines changed

src/dag.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ use crate::error::Error;
44
use crate::ipld::{decode_ipld, encode_ipld, Ipld};
55
use crate::path::{IpfsPath, SlashedPath};
66
use crate::repo::RepoTypes;
7-
use crate::Ipfs;
8-
use bitswap::Block;
7+
use crate::{Block, Ipfs};
98
use cid::{Cid, Codec, Version};
109
use ipfs_unixfs::{
1110
dagpb::{wrap_node_data, NodeData},

src/repo/fs/blocks.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ use super::{block_path, filestem_to_block_cid};
22
use super::{BlockRm, BlockRmError, RepoCid};
33
use crate::error::Error;
44
use crate::repo::{BlockPut, BlockStore};
5+
use crate::Block;
56
use async_trait::async_trait;
6-
use bitswap::Block;
77
use cid::Cid;
88
use std::collections::HashMap;
99
use std::hash::Hash;
@@ -434,7 +434,7 @@ fn write_through_tempfile(
434434
#[cfg(test)]
435435
mod tests {
436436
use super::*;
437-
use bitswap::Block;
437+
use crate::Block;
438438
use cid::{Cid, Codec};
439439
use hex_literal::hex;
440440
use multihash::Sha2_256;

src/repo/mem.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
//! Volatile memory backed repo
22
use crate::error::Error;
33
use crate::repo::{BlockPut, BlockStore, Column, DataStore, PinKind, PinMode, PinStore};
4+
use crate::Block;
45
use async_trait::async_trait;
5-
use bitswap::Block;
66
use cid::Cid;
77
use std::convert::TryFrom;
88
use std::path::PathBuf;
@@ -654,7 +654,7 @@ crate::pinstore_interface_tests!(common_tests, crate::repo::mem::MemDataStore::n
654654
#[cfg(test)]
655655
mod tests {
656656
use super::*;
657-
use bitswap::Block;
657+
use crate::Block;
658658
use cid::{Cid, Codec};
659659
use multihash::Sha2_256;
660660
use std::env::temp_dir;

src/repo/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@ use crate::error::Error;
33
use crate::p2p::KadResult;
44
use crate::path::IpfsPath;
55
use crate::subscription::{RequestKind, SubscriptionFuture, SubscriptionRegistry};
6-
use crate::IpfsOptions;
6+
use crate::{Block, IpfsOptions};
77
use async_trait::async_trait;
8-
use bitswap::Block;
98
use cid::{self, Cid};
109
use core::convert::TryFrom;
1110
use core::fmt::Debug;

src/unixfs/cat.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
use crate::{
22
dag::{ResolveError, UnexpectedResolved},
3-
Error, Ipfs, IpfsTypes,
3+
Block, Error, Ipfs, IpfsTypes,
44
};
55
use async_stream::stream;
6-
use bitswap::Block;
76
use cid::Cid;
87
use futures::stream::Stream;
98
use ipfs_unixfs::file::{visit::IdleFileVisit, FileReadFailed};

0 commit comments

Comments
 (0)