diff options
author | Bogdan Arabadzhi <bogdan.today@gmail.com> | 2019-10-15 12:56:40 +0200 |
---|---|---|
committer | Bogdan Arabadzhi <bogdan.today@gmail.com> | 2019-10-15 12:56:40 +0200 |
commit | 1f9f0261b425cd2e94a7efd3ae4bdfdab5480e7d (patch) | |
tree | 272f4eba88e57e5810c2c17f01a2c559b42c27b9 /ipfs-api/src/response | |
parent | c0d0f75dc46331a429bf211fc682a42b57a594e3 (diff) |
Migrate to Rust 2018 edition
Diffstat (limited to 'ipfs-api/src/response')
31 files changed, 48 insertions, 2 deletions
diff --git a/ipfs-api/src/response/add.rs b/ipfs-api/src/response/add.rs index 24c82ac..e9a923d 100644 --- a/ipfs-api/src/response/add.rs +++ b/ipfs-api/src/response/add.rs @@ -6,6 +6,8 @@ // copied, modified, or distributed except according to those terms. // +use crate::serde::Deserialize; + #[derive(Debug, Deserialize)] #[serde(rename_all = "PascalCase")] pub struct AddResponse { diff --git a/ipfs-api/src/response/bitswap.rs b/ipfs-api/src/response/bitswap.rs index 143680c..95af909 100644 --- a/ipfs-api/src/response/bitswap.rs +++ b/ipfs-api/src/response/bitswap.rs @@ -7,6 +7,7 @@ // use crate::response::serde; +use crate::serde::Deserialize; #[derive(Debug, Deserialize)] #[serde(rename_all = "PascalCase")] diff --git a/ipfs-api/src/response/block.rs b/ipfs-api/src/response/block.rs index c04bd89..7ec9e3d 100644 --- a/ipfs-api/src/response/block.rs +++ b/ipfs-api/src/response/block.rs @@ -6,6 +6,8 @@ // copied, modified, or distributed except according to those terms. // +use crate::serde::Deserialize; + #[derive(Debug, Deserialize)] #[serde(rename_all = "PascalCase")] pub struct BlockPutResponse { diff --git a/ipfs-api/src/response/bootstrap.rs b/ipfs-api/src/response/bootstrap.rs index 6700073..838cdbb 100644 --- a/ipfs-api/src/response/bootstrap.rs +++ b/ipfs-api/src/response/bootstrap.rs @@ -7,6 +7,7 @@ // use crate::response::serde; +use crate::serde::Deserialize; #[derive(Debug, Deserialize)] #[serde(rename_all = "PascalCase")] diff --git a/ipfs-api/src/response/commands.rs b/ipfs-api/src/response/commands.rs index b3d5f86..b23d830 100644 --- a/ipfs-api/src/response/commands.rs +++ b/ipfs-api/src/response/commands.rs @@ -7,6 +7,7 @@ // use crate::response::serde; +use crate::serde::Deserialize; #[derive(Debug, Deserialize)] #[serde(rename_all = "PascalCase")] diff --git a/ipfs-api/src/response/dag.rs b/ipfs-api/src/response/dag.rs index 2efc0f6..c53a282 100644 --- a/ipfs-api/src/response/dag.rs +++ b/ipfs-api/src/response/dag.rs @@ -7,6 +7,7 @@ // use crate::response::serde; +use crate::serde::Deserialize; use std::collections::HashMap; #[derive(Debug, Deserialize)] diff --git a/ipfs-api/src/response/dht.rs b/ipfs-api/src/response/dht.rs index 31f64f5..f2207aa 100644 --- a/ipfs-api/src/response/dht.rs +++ b/ipfs-api/src/response/dht.rs @@ -7,7 +7,10 @@ // use crate::response::serde; -use serde::de::{Deserialize, Deserializer, Error}; +use crate::serde::{ + de::{Deserializer, Error}, + Deserialize, +}; /// See /// [libp2p](https://github.com/libp2p/go-libp2p-routing/blob/master/notifications/query.go#L16). diff --git a/ipfs-api/src/response/dns.rs b/ipfs-api/src/response/dns.rs index 69f79d2..8142c0f 100644 --- a/ipfs-api/src/response/dns.rs +++ b/ipfs-api/src/response/dns.rs @@ -6,6 +6,8 @@ // copied, modified, or distributed except according to those terms. // +use crate::serde::Deserialize; + #[derive(Debug, Deserialize)] #[serde(rename_all = "PascalCase")] pub struct DnsResponse { diff --git a/ipfs-api/src/response/error.rs b/ipfs-api/src/response/error.rs index e816673..5287a3d 100644 --- a/ipfs-api/src/response/error.rs +++ b/ipfs-api/src/response/error.rs @@ -5,6 +5,9 @@ // http://opensource.org/licenses/MIT>, at your option. This file may not be // copied, modified, or distributed except according to those terms. // + +use crate::serde::Deserialize; + #[cfg(feature = "actix")] use awc; use http; diff --git a/ipfs-api/src/response/file.rs b/ipfs-api/src/response/file.rs index 5804b78..7853249 100644 --- a/ipfs-api/src/response/file.rs +++ b/ipfs-api/src/response/file.rs @@ -7,6 +7,7 @@ // use crate::response::{serde, IpfsHeader}; +use crate::serde::Deserialize; use std::collections::HashMap; #[derive(Debug, Deserialize)] diff --git a/ipfs-api/src/response/files.rs b/ipfs-api/src/response/files.rs index eafc234..069ba32 100644 --- a/ipfs-api/src/response/files.rs +++ b/ipfs-api/src/response/files.rs @@ -7,6 +7,7 @@ // use crate::response::serde; +use crate::serde::Deserialize; pub type FilesCpResponse = (); diff --git a/ipfs-api/src/response/filestore.rs b/ipfs-api/src/response/filestore.rs index 0ad0474..fe898f5 100644 --- a/ipfs-api/src/response/filestore.rs +++ b/ipfs-api/src/response/filestore.rs @@ -6,6 +6,8 @@ // copied, modified, or distributed except according to those terms. // +use crate::serde::Deserialize; + #[derive(Debug, Deserialize)] #[serde(rename_all = "PascalCase")] pub struct FilestoreDupsResponse { diff --git a/ipfs-api/src/response/id.rs b/ipfs-api/src/response/id.rs index 40cfff7..d8eaf98 100644 --- a/ipfs-api/src/response/id.rs +++ b/ipfs-api/src/response/id.rs @@ -7,6 +7,7 @@ // use crate::response::serde; +use crate::serde::Deserialize; #[derive(Debug, Deserialize)] #[serde(rename_all = "PascalCase")] diff --git a/ipfs-api/src/response/key.rs b/ipfs-api/src/response/key.rs index d9d604a..6c7099e 100644 --- a/ipfs-api/src/response/key.rs +++ b/ipfs-api/src/response/key.rs @@ -7,6 +7,7 @@ // use crate::response::serde; +use crate::serde::Deserialize; #[derive(Debug, Deserialize)] #[serde(rename_all = "PascalCase")] diff --git a/ipfs-api/src/response/log.rs b/ipfs-api/src/response/log.rs index 1c096e0..0d37510 100644 --- a/ipfs-api/src/response/log.rs +++ b/ipfs-api/src/response/log.rs @@ -7,6 +7,7 @@ // use crate::response::serde; +use crate::serde::Deserialize; #[derive(Debug, Deserialize)] #[serde(rename_all = "PascalCase")] diff --git a/ipfs-api/src/response/ls.rs b/ipfs-api/src/response/ls.rs index 5977328..5e6fd2f 100644 --- a/ipfs-api/src/response/ls.rs +++ b/ipfs-api/src/response/ls.rs @@ -7,6 +7,7 @@ // use crate::response::serde; +use crate::serde::Deserialize; #[derive(Deserialize)] #[serde(rename_all = "PascalCase")] diff --git a/ipfs-api/src/response/mod.rs b/ipfs-api/src/response/mod.rs index 0f00a80..8aa6f14 100644 --- a/ipfs-api/src/response/mod.rs +++ b/ipfs-api/src/response/mod.rs @@ -8,6 +8,8 @@ //! This module contains structures returned by the IPFS API. +use crate::serde::Deserialize; + pub use self::add::*; pub use self::bitswap::*; pub use self::block::*; diff --git a/ipfs-api/src/response/mount.rs b/ipfs-api/src/response/mount.rs index 59f2bf3..9757bd3 100644 --- a/ipfs-api/src/response/mount.rs +++ b/ipfs-api/src/response/mount.rs @@ -6,6 +6,8 @@ // copied, modified, or distributed except according to those terms. // +use crate::serde::Deserialize; + #[derive(Deserialize)] #[serde(rename_all = "PascalCase")] pub struct MountResponse { diff --git a/ipfs-api/src/response/name.rs b/ipfs-api/src/response/name.rs index de142db..600f83d 100644 --- a/ipfs-api/src/response/name.rs +++ b/ipfs-api/src/response/name.rs @@ -6,6 +6,8 @@ // copied, modified, or distributed except according to those terms. // +use crate::serde::Deserialize; + #[derive(Deserialize)] #[serde(rename_all = "PascalCase")] pub struct NamePublishResponse { diff --git a/ipfs-api/src/response/object.rs b/ipfs-api/src/response/object.rs index c16038a..c616165 100644 --- a/ipfs-api/src/response/object.rs +++ b/ipfs-api/src/response/object.rs @@ -7,6 +7,7 @@ // use crate::response::{serde, IpfsHeader}; +use crate::serde::Deserialize; use std::collections::HashMap; #[derive(Debug, Deserialize)] diff --git a/ipfs-api/src/response/pin.rs b/ipfs-api/src/response/pin.rs index 7e03e91..3a303ba 100644 --- a/ipfs-api/src/response/pin.rs +++ b/ipfs-api/src/response/pin.rs @@ -7,6 +7,7 @@ // use crate::response::serde; +use crate::serde::Deserialize; use std::collections::HashMap; #[derive(Debug, Deserialize)] diff --git a/ipfs-api/src/response/ping.rs b/ipfs-api/src/response/ping.rs index 977ef90..b094c8c 100644 --- a/ipfs-api/src/response/ping.rs +++ b/ipfs-api/src/response/ping.rs @@ -6,6 +6,8 @@ // copied, modified, or distributed except according to those terms. // +use crate::serde::Deserialize; + #[derive(Debug, Deserialize)] #[serde(rename_all = "PascalCase")] pub struct PingResponse { diff --git a/ipfs-api/src/response/pubsub.rs b/ipfs-api/src/response/pubsub.rs index a5f6249..c645fb6 100644 --- a/ipfs-api/src/response/pubsub.rs +++ b/ipfs-api/src/response/pubsub.rs @@ -7,6 +7,7 @@ // use crate::response::serde; +use crate::serde::Deserialize; #[derive(Debug, Deserialize)] #[serde(rename_all = "PascalCase")] diff --git a/ipfs-api/src/response/refs.rs b/ipfs-api/src/response/refs.rs index 6f66cf0..52061ba 100644 --- a/ipfs-api/src/response/refs.rs +++ b/ipfs-api/src/response/refs.rs @@ -6,6 +6,8 @@ // copied, modified, or distributed except according to those terms. // +use crate::serde::Deserialize; + #[derive(Debug, Deserialize)] #[serde(rename_all = "PascalCase")] pub struct RefsLocalResponse { diff --git a/ipfs-api/src/response/repo.rs b/ipfs-api/src/response/repo.rs index 82e3e96..b0ba62c 100644 --- a/ipfs-api/src/response/repo.rs +++ b/ipfs-api/src/response/repo.rs @@ -7,6 +7,7 @@ // use crate::response::serde; +use crate::serde::Deserialize; use std::collections::HashMap; #[derive(Deserialize)] diff --git a/ipfs-api/src/response/resolve.rs b/ipfs-api/src/response/resolve.rs index a691391..9a0a755 100644 --- a/ipfs-api/src/response/resolve.rs +++ b/ipfs-api/src/response/resolve.rs @@ -6,6 +6,8 @@ // copied, modified, or distributed except according to those terms. // +use crate::serde::Deserialize; + #[derive(Deserialize)] #[serde(rename_all = "PascalCase")] pub struct ResolveResponse { diff --git a/ipfs-api/src/response/serde.rs b/ipfs-api/src/response/serde.rs index 4e7b070..5b3e2e6 100644 --- a/ipfs-api/src/response/serde.rs +++ b/ipfs-api/src/response/serde.rs @@ -6,7 +6,7 @@ // copied, modified, or distributed except according to those terms. // -use serde::de::{Deserialize, Deserializer, MapAccess, SeqAccess, Visitor}; +use crate::serde::de::{Deserialize, Deserializer, MapAccess, SeqAccess, Visitor}; use std::collections::HashMap; use std::error::Error; use std::fmt; diff --git a/ipfs-api/src/response/stats.rs b/ipfs-api/src/response/stats.rs index 2a8cd03..0d99844 100644 --- a/ipfs-api/src/response/stats.rs +++ b/ipfs-api/src/response/stats.rs @@ -7,6 +7,7 @@ // use crate::response::{BitswapStatResponse, RepoStatResponse}; +use crate::serde::Deserialize; pub type StatsBitswapResponse = BitswapStatResponse; diff --git a/ipfs-api/src/response/swarm.rs b/ipfs-api/src/response/swarm.rs index e892712..3b0b097 100644 --- a/ipfs-api/src/response/swarm.rs +++ b/ipfs-api/src/response/swarm.rs @@ -7,6 +7,7 @@ // use crate::response::serde; +use crate::serde::Deserialize; #[derive(Debug, Deserialize)] #[serde(rename_all = "PascalCase")] diff --git a/ipfs-api/src/response/tar.rs b/ipfs-api/src/response/tar.rs index 08a0089..aacc7ce 100644 --- a/ipfs-api/src/response/tar.rs +++ b/ipfs-api/src/response/tar.rs @@ -6,6 +6,8 @@ // copied, modified, or distributed except according to those terms. // +use crate::serde::Deserialize; + #[derive(Debug, Deserialize)] #[serde(rename_all = "PascalCase")] pub struct TarAddResponse { diff --git a/ipfs-api/src/response/version.rs b/ipfs-api/src/response/version.rs index b35511d..57c6857 100644 --- a/ipfs-api/src/response/version.rs +++ b/ipfs-api/src/response/version.rs @@ -6,6 +6,8 @@ // copied, modified, or distributed except according to those terms. // +use crate::serde::Deserialize; + #[derive(Debug, Deserialize)] #[serde(rename_all = "PascalCase")] pub struct VersionResponse { |