From ff501f440b23eca7e361e67a8262b245347a50d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89lo=C3=AFs?= <elois@ifee.fr> Date: Sat, 8 Dec 2018 20:43:20 +0100 Subject: [PATCH] [ref] migrate to rust edition 2018 --- .gitlab-ci.yml | 4 ++-- lib/core/conf/Cargo.toml | 1 + lib/core/conf/keys.rs | 2 +- lib/core/core/Cargo.toml | 1 + lib/core/core/cli/mod.rs | 10 +++++----- lib/core/core/cli/reset.rs | 2 +- lib/core/core/lib.rs | 4 ++-- lib/core/message/Cargo.toml | 1 + lib/core/message/events.rs | 2 +- lib/core/message/lib.rs | 6 +++--- lib/core/message/requests.rs | 2 +- lib/core/module/Cargo.toml | 1 + lib/core/network/Cargo.toml | 1 + lib/core/network/events.rs | 8 ++++---- lib/core/network/lib.rs | 2 +- lib/core/network/requests.rs | 5 ++--- .../blockchain/blockchain-dal/Cargo.toml | 1 + .../blockchain/blockchain-dal/balance.rs | 4 ++-- lib/modules/blockchain/blockchain-dal/block.rs | 2 +- lib/modules/blockchain/blockchain-dal/certs.rs | 2 +- .../blockchain-dal/currency_params.rs | 4 ++-- .../blockchain/blockchain-dal/identity.rs | 4 ++-- lib/modules/blockchain/blockchain-dal/lib.rs | 8 ++++---- lib/modules/blockchain/blockchain-dal/tools.rs | 9 ++++----- .../blockchain/blockchain-dal/writers/block.rs | 6 +++--- .../blockchain-dal/writers/certification.rs | 4 ++-- .../blockchain-dal/writers/dividend.rs | 4 ++-- .../blockchain-dal/writers/identity.rs | 6 +++--- .../blockchain-dal/writers/requests.rs | 12 ++++++------ .../blockchain-dal/writers/transaction.rs | 4 ++-- lib/modules/blockchain/blockchain/Cargo.toml | 1 + .../blockchain/check_and_apply_block.rs | 4 ++-- lib/modules/blockchain/blockchain/dbex.rs | 2 +- lib/modules/blockchain/blockchain/lib.rs | 6 +++--- lib/modules/blockchain/blockchain/sync.rs | 4 ++-- .../blockchain/blockchain/ts_parsers.rs | 2 +- lib/modules/skeleton/Cargo.toml | 1 + lib/modules/tui/Cargo.toml | 1 + lib/modules/ws2p-v1-legacy/Cargo.toml | 1 + lib/modules/ws2p-v1-legacy/datas.rs | 6 +++--- lib/modules/ws2p-v1-legacy/heads.rs | 2 +- lib/modules/ws2p-v1-legacy/lib.rs | 16 ++++++++-------- lib/modules/ws2p-v1-legacy/ws2p_connection.rs | 6 +++--- lib/modules/ws2p/ws2p-messages/Cargo.toml | 1 + lib/modules/ws2p/ws2p-messages/lib.rs | 6 +++--- lib/modules/ws2p/ws2p-messages/v2/connect.rs | 2 +- lib/modules/ws2p/ws2p-messages/v2/mod.rs | 6 +++--- lib/modules/ws2p/ws2p-messages/v2/ok.rs | 2 +- .../ws2p/ws2p-messages/v2/req_responses.rs | 2 +- lib/modules/ws2p/ws2p-messages/v2/requests.rs | 2 +- .../ws2p/ws2p-messages/v2/secret_flags.rs | 2 +- lib/modules/ws2p/ws2p/Cargo.toml | 1 + .../src/controllers/handler/connect_msg.rs | 6 +++--- .../ws2p/ws2p/src/controllers/handler/mod.rs | 10 +++++----- .../controllers/incoming_connections/mod.rs | 10 +++++----- .../controllers/outgoing_connections/mod.rs | 10 +++++----- lib/modules/ws2p/ws2p/src/lib.rs | 2 +- lib/modules/ws2p/ws2p/src/services/mod.rs | 2 +- lib/modules/ws2p/ws2p/src/services/outgoing.rs | 4 ++-- lib/tools/crypto/Cargo.toml | 1 + lib/tools/crypto/src/hashs/mod.rs | 2 +- lib/tools/crypto/src/keys/bin_signable.rs | 2 +- lib/tools/crypto/src/keys/ed25519.rs | 2 +- lib/tools/documents/Cargo.toml | 1 + lib/tools/documents/src/blockstamp.rs | 2 +- lib/tools/documents/src/lib.rs | 4 ++-- lib/tools/documents/src/v10/block.rs | 18 +++++++++--------- lib/tools/documents/src/v10/certification.rs | 8 ++++---- lib/tools/documents/src/v10/identity.rs | 12 ++++++------ lib/tools/documents/src/v10/membership.rs | 8 ++++---- lib/tools/documents/src/v10/mod.rs | 16 ++++++++-------- lib/tools/documents/src/v10/revocation.rs | 8 ++++---- lib/tools/documents/src/v10/transaction.rs | 12 ++++++------ lib/tools/network-documents/Cargo.toml | 1 + lib/tools/network-documents/src/lib.rs | 8 ++++---- .../network-documents/src/network_endpoint.rs | 4 ++-- .../network-documents/src/network_head.rs | 6 +++--- .../network-documents/src/network_head_v2.rs | 2 +- .../network-documents/src/network_head_v3.rs | 4 ++-- .../network-documents/src/network_peer.rs | 6 +++--- lib/tools/wot/Cargo.toml | 1 + lib/tools/wot/data/rusty.rs | 6 +++--- lib/tools/wot/lib.rs | 12 ++++++------ lib/tools/wot/operations/centrality.rs | 4 ++-- lib/tools/wot/operations/distance.rs | 4 ++-- lib/tools/wot/operations/file.rs | 4 ++-- lib/tools/wot/operations/path.rs | 4 ++-- 87 files changed, 209 insertions(+), 195 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4ba197f9..71311c2c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -38,14 +38,14 @@ variables: - rustc --version && cargo --version .rust_stable_armv7: &rust_stable_armv7 - image: registry.duniter.org/docker/rust/armv7-builder:v0.0.4 + image: registry.duniter.org/docker/rust/armv7-builder:v0.1 tags: - redshift-rs-stable before_script: - rustc --version && cargo --version .rust_stable_win64: &rust_stable_win64 - image: registry.duniter.org/docker/rust/win64-builder:v0.0.7 + image: registry.duniter.org/docker/rust/win64-builder:v0.1.0 tags: - redshift-rs-stable before_script: diff --git a/lib/core/conf/Cargo.toml b/lib/core/conf/Cargo.toml index 27d5f84f..6dabfbe2 100644 --- a/lib/core/conf/Cargo.toml +++ b/lib/core/conf/Cargo.toml @@ -4,6 +4,7 @@ version = "0.1.0-a0.1" authors = ["librelois <elois@ifee.fr>"] description = "Configuration module for the Duniter project." license = "AGPL-3.0" +edition = "2018" [lib] path = "lib.rs" diff --git a/lib/core/conf/keys.rs b/lib/core/conf/keys.rs index dc487b56..e89a0ab6 100644 --- a/lib/core/conf/keys.rs +++ b/lib/core/conf/keys.rs @@ -24,8 +24,8 @@ extern crate rpassword; +use crate::*; use std::io; -use *; #[derive(Debug, Copy, Clone)] /// Errors encountered by the wizard diff --git a/lib/core/core/Cargo.toml b/lib/core/core/Cargo.toml index d1922462..9a89af79 100644 --- a/lib/core/core/Cargo.toml +++ b/lib/core/core/Cargo.toml @@ -4,6 +4,7 @@ version = "0.1.0-a0.1" authors = ["librelois <elois@ifee.fr>"] description = "Duniter-rs core." license = "AGPL-3.0" +edition = "2018" [lib] path = "lib.rs" diff --git a/lib/core/core/cli/mod.rs b/lib/core/core/cli/mod.rs index 8bafca54..8e69af1c 100644 --- a/lib/core/core/cli/mod.rs +++ b/lib/core/core/cli/mod.rs @@ -23,13 +23,13 @@ pub mod modules; pub mod reset; pub mod start; -pub use cli::keys::KeysOpt; -pub use dbex::*; +pub use crate::cli::keys::KeysOpt; +pub use crate::dbex::*; +pub use crate::modules::*; +pub use crate::reset::*; +pub use crate::start::*; pub use duniter_network::cli::sync::SyncOpt; use log::Level; -pub use modules::*; -pub use reset::*; -pub use start::*; #[derive(StructOpt, Debug)] #[structopt( diff --git a/lib/core/core/cli/reset.rs b/lib/core/core/cli/reset.rs index 0b112cf2..a7fc8a34 100644 --- a/lib/core/core/cli/reset.rs +++ b/lib/core/core/cli/reset.rs @@ -17,7 +17,7 @@ extern crate structopt; -use cli::InvalidInput; +use crate::cli::InvalidInput; use std::str::FromStr; #[derive(StructOpt, Debug, Copy, Clone)] diff --git a/lib/core/core/lib.rs b/lib/core/core/lib.rs index db66acf6..3c1b7747 100644 --- a/lib/core/core/lib.rs +++ b/lib/core/core/lib.rs @@ -60,8 +60,8 @@ use log::Level; use simplelog::*; //use std::error::Error; //use std::fmt::{Debug, Formatter}; -use cli::keys::*; -use cli::*; +use crate::cli::keys::*; +use crate::cli::*; use std::fs; use std::fs::{File, OpenOptions}; use std::sync::mpsc; diff --git a/lib/core/message/Cargo.toml b/lib/core/message/Cargo.toml index c0293fa5..1e830241 100644 --- a/lib/core/message/Cargo.toml +++ b/lib/core/message/Cargo.toml @@ -4,6 +4,7 @@ version = "0.1.0-a0.1" authors = ["librelois <elois@ifee.fr>"] description = "message model for the Durs project." license = "AGPL-3.0" +edition = "2018" [lib] path = "lib.rs" diff --git a/lib/core/message/events.rs b/lib/core/message/events.rs index 57954835..fad3f21a 100644 --- a/lib/core/message/events.rs +++ b/lib/core/message/events.rs @@ -13,10 +13,10 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. +use crate::*; use dubp_documents::v10::block::BlockDocument; use dubp_documents::*; use duniter_network::events::NetworkEvent; -use *; /// The DURS event message. #[derive(Debug, Clone)] diff --git a/lib/core/message/lib.rs b/lib/core/message/lib.rs index de0476ac..9e53b74d 100644 --- a/lib/core/message/lib.rs +++ b/lib/core/message/lib.rs @@ -48,9 +48,9 @@ pub mod requests; /// Define requests responses pub mod responses; -use events::*; -use requests::*; -use responses::*; +use crate::events::*; +use crate::requests::*; +use crate::responses::*; /// Message exchanged between Durs modules #[derive(Debug, Clone)] diff --git a/lib/core/message/requests.rs b/lib/core/message/requests.rs index 0e5e0107..873874a7 100644 --- a/lib/core/message/requests.rs +++ b/lib/core/message/requests.rs @@ -13,11 +13,11 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. +use crate::*; use dubp_documents::BlockId; use duniter_network::requests::OldNetworkRequest; use dup_crypto::hashs::Hash; use dup_crypto::keys::*; -use *; #[derive(Debug, Clone)] /// Modules request content diff --git a/lib/core/module/Cargo.toml b/lib/core/module/Cargo.toml index c91137a9..1cfbe9cb 100644 --- a/lib/core/module/Cargo.toml +++ b/lib/core/module/Cargo.toml @@ -4,6 +4,7 @@ version = "0.1.0-a0.1" authors = ["librelois <elois@duniter.org>"] description = "Modules model for the Duniter project." license = "AGPL-3.0" +edition = "2018" [lib] path = "lib.rs" diff --git a/lib/core/network/Cargo.toml b/lib/core/network/Cargo.toml index 71dd0f4a..41621d19 100644 --- a/lib/core/network/Cargo.toml +++ b/lib/core/network/Cargo.toml @@ -4,6 +4,7 @@ version = "0.1.0-a0.1" authors = ["librelois <elois@duniter.org>"] description = "Network model for the Durs project." license = "AGPL-3.0" +edition = "2018" [lib] path = "lib.rs" diff --git a/lib/core/network/events.rs b/lib/core/network/events.rs index 5cb4a8c6..bf039835 100644 --- a/lib/core/network/events.rs +++ b/lib/core/network/events.rs @@ -15,10 +15,10 @@ //! Defined network events. -use documents::*; -use network_head::NetworkHead; -use network_peer::PeerCard; -use NodeFullId; +use crate::documents::*; +use crate::network_head::NetworkHead; +use crate::network_peer::PeerCard; +use crate::NodeFullId; #[derive(Debug, Clone)] /// Type containing a network event, each time a network event occurs it's relayed to all modules diff --git a/lib/core/network/lib.rs b/lib/core/network/lib.rs index 4b617557..cef3dfb5 100644 --- a/lib/core/network/lib.rs +++ b/lib/core/network/lib.rs @@ -37,7 +37,7 @@ extern crate serde_json; #[macro_use] extern crate structopt; -use cli::sync::SyncOpt; +use crate::cli::sync::SyncOpt; use duniter_module::*; use durs_network_documents::network_endpoint::ApiFeatures; use durs_network_documents::network_head::NetworkHead; diff --git a/lib/core/network/requests.rs b/lib/core/network/requests.rs index bcf680a3..2f02a3fd 100644 --- a/lib/core/network/requests.rs +++ b/lib/core/network/requests.rs @@ -15,10 +15,9 @@ //! Defined network requests. -use documents::*; +use crate::documents::*; +use crate::*; use dubp_documents::Blockstamp; -use duniter_module::*; -use *; #[derive(Debug, Copy, Clone)] /// Type containing a request addressed to the network module diff --git a/lib/modules/blockchain/blockchain-dal/Cargo.toml b/lib/modules/blockchain/blockchain-dal/Cargo.toml index f91ec6ff..bfc3feb4 100644 --- a/lib/modules/blockchain/blockchain-dal/Cargo.toml +++ b/lib/modules/blockchain/blockchain-dal/Cargo.toml @@ -4,6 +4,7 @@ version = "0.1.0-a0.1" authors = ["librelois <elois@ifee.fr>"] description = "Data Access Layer for Durs Blockchain module." license = "AGPL-3.0" +edition = "2018" [lib] path = "lib.rs" diff --git a/lib/modules/blockchain/blockchain-dal/balance.rs b/lib/modules/blockchain/blockchain-dal/balance.rs index 0852960c..6cacb241 100644 --- a/lib/modules/blockchain/blockchain-dal/balance.rs +++ b/lib/modules/blockchain/blockchain-dal/balance.rs @@ -13,8 +13,8 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. -use sources::*; -use *; +use crate::sources::*; +use crate::*; /// Get address balance pub fn get_address_balance( diff --git a/lib/modules/blockchain/blockchain-dal/block.rs b/lib/modules/blockchain/blockchain-dal/block.rs index 4698ae19..60ccb8a2 100644 --- a/lib/modules/blockchain/blockchain-dal/block.rs +++ b/lib/modules/blockchain/blockchain-dal/block.rs @@ -14,13 +14,13 @@ // along with this program. If not, see <https://www.gnu.org/licenses/>. use super::constants::MAX_FORKS; +use crate::*; use dubp_documents::v10::BlockDocument; use dubp_documents::Document; use dubp_documents::{BlockHash, BlockId, Blockstamp, PreviousBlockstamp}; use dup_crypto::keys::*; use durs_wot::NodeId; use std::collections::HashMap; -use *; #[derive(Clone, Debug, Deserialize, Serialize)] /// A block as it is saved in a database diff --git a/lib/modules/blockchain/blockchain-dal/certs.rs b/lib/modules/blockchain/blockchain-dal/certs.rs index a28e5455..9edbf5a4 100644 --- a/lib/modules/blockchain/blockchain-dal/certs.rs +++ b/lib/modules/blockchain/blockchain-dal/certs.rs @@ -16,10 +16,10 @@ extern crate dubp_documents; extern crate durs_wot; +use crate::{BinDB, CertsExpirV10Datas, DALError}; use dubp_documents::BlockId; use durs_wot::NodeId; use std::collections::HashMap; -use {BinDB, CertsExpirV10Datas, DALError}; /// Find certifications that emitted in indicated blocks expiring pub fn find_expire_certs( diff --git a/lib/modules/blockchain/blockchain-dal/currency_params.rs b/lib/modules/blockchain/blockchain-dal/currency_params.rs index c88d4a45..a695f05f 100644 --- a/lib/modules/blockchain/blockchain-dal/currency_params.rs +++ b/lib/modules/blockchain/blockchain-dal/currency_params.rs @@ -13,10 +13,10 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. -use constants::*; +use crate::constants::*; +use crate::*; use dubp_documents::v10::block::BlockV10Parameters; use dubp_documents::CurrencyName; -use *; #[derive(Debug, Copy, Clone)] /// Curerncy parameters diff --git a/lib/modules/blockchain/blockchain-dal/identity.rs b/lib/modules/blockchain/blockchain-dal/identity.rs index be1d79e2..eec031d7 100644 --- a/lib/modules/blockchain/blockchain-dal/identity.rs +++ b/lib/modules/blockchain/blockchain-dal/identity.rs @@ -13,13 +13,13 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. -use currency_params::CurrencyParameters; +use crate::currency_params::CurrencyParameters; +use crate::{BinDB, DALError, IdentitiesV10Datas, MsExpirV10Datas}; use dubp_documents::v10::identity::IdentityDocument; use dubp_documents::{BlockId, Blockstamp}; use dup_crypto::keys::*; use durs_wot::NodeId; use std::collections::HashMap; -use {BinDB, DALError, IdentitiesV10Datas, MsExpirV10Datas}; #[derive(Clone, Debug, Deserialize, Serialize)] /// Identity state diff --git a/lib/modules/blockchain/blockchain-dal/lib.rs b/lib/modules/blockchain/blockchain-dal/lib.rs index 43eca14d..d7c45790 100644 --- a/lib/modules/blockchain/blockchain-dal/lib.rs +++ b/lib/modules/blockchain/blockchain-dal/lib.rs @@ -91,10 +91,10 @@ use std::fs; use std::panic::UnwindSafe; use std::path::PathBuf; -use block::DALBlock; -use identity::DALIdentity; -use sources::{SourceAmount, UTXOContentV10, UTXOIndexV10}; -use writers::transaction::DALTxV10; +use crate::block::DALBlock; +use crate::identity::DALIdentity; +use crate::sources::{SourceAmount, UTXOContentV10, UTXOIndexV10}; +use crate::writers::transaction::DALTxV10; #[derive(Debug, Deserialize, Copy, Clone, Ord, PartialEq, PartialOrd, Eq, Hash, Serialize)] /// Each fork has a unique identifier. The local blockchain (also called local branch) has ForkId equal to zero. diff --git a/lib/modules/blockchain/blockchain-dal/tools.rs b/lib/modules/blockchain/blockchain-dal/tools.rs index 12a91949..0800e127 100644 --- a/lib/modules/blockchain/blockchain-dal/tools.rs +++ b/lib/modules/blockchain/blockchain-dal/tools.rs @@ -113,15 +113,14 @@ pub fn compute_distances<T: WebOfTrust + Sync>( }, ) .expect("Fatal Error: compute_distance return None !"); - let mut distance = ((f64::from(distance_datas.success) + let distance = ((f64::from(distance_datas.success) / (x_percent * f64::from(distance_datas.sentries))) * 100.0) as usize; distances.push(distance); average_distance += distance; - let mut connectivity = - ((f64::from(distance_datas.success - distance_datas.success_at_border) - / (x_percent * f64::from(distance_datas.sentries))) - * 100.0) as usize; + let connectivity = ((f64::from(distance_datas.success - distance_datas.success_at_border) + / (x_percent * f64::from(distance_datas.sentries))) + * 100.0) as usize; connectivities.push(connectivity); average_connectivity += connectivity; } diff --git a/lib/modules/blockchain/blockchain-dal/writers/block.rs b/lib/modules/blockchain/blockchain-dal/writers/block.rs index 46a6bb11..d2d975ae 100644 --- a/lib/modules/blockchain/blockchain-dal/writers/block.rs +++ b/lib/modules/blockchain/blockchain-dal/writers/block.rs @@ -13,12 +13,12 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. -use block::DALBlock; +use crate::block::DALBlock; +use crate::ForkId; +use crate::{BinDB, DALError, ForksBlocksV10Datas, ForksV10Datas, LocalBlockchainV10Datas}; use dubp_documents::Document; use dubp_documents::{BlockHash, BlockId, PreviousBlockstamp}; use std::collections::HashMap; -use ForkId; -use {BinDB, DALError, ForksBlocksV10Datas, ForksV10Datas, LocalBlockchainV10Datas}; /// Write DALBlock in databases pub fn write( diff --git a/lib/modules/blockchain/blockchain-dal/writers/certification.rs b/lib/modules/blockchain/blockchain-dal/writers/certification.rs index c8be5195..de0f052b 100644 --- a/lib/modules/blockchain/blockchain-dal/writers/certification.rs +++ b/lib/modules/blockchain/blockchain-dal/writers/certification.rs @@ -13,12 +13,12 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. -use currency_params::CurrencyParameters; +use crate::currency_params::CurrencyParameters; +use crate::{BinDB, CertsExpirV10Datas, DALError, IdentitiesV10Datas}; use dubp_documents::v10::certification::CompactCertificationDocument; use dubp_documents::BlockId; use dup_crypto::keys::*; use durs_wot::NodeId; -use {BinDB, CertsExpirV10Datas, DALError, IdentitiesV10Datas}; /// Apply "certification" event in databases pub fn write_certification( diff --git a/lib/modules/blockchain/blockchain-dal/writers/dividend.rs b/lib/modules/blockchain/blockchain-dal/writers/dividend.rs index 9256ae65..94ca2645 100644 --- a/lib/modules/blockchain/blockchain-dal/writers/dividend.rs +++ b/lib/modules/blockchain/blockchain-dal/writers/dividend.rs @@ -13,12 +13,12 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. +use crate::sources::SourceAmount; +use crate::*; use dubp_documents::v10::transaction::*; use dubp_documents::BlockId; use dup_crypto::keys::PubKey; -use sources::SourceAmount; use std::collections::{HashMap, HashSet}; -use *; /// Apply UD creation in databases pub fn create_du( diff --git a/lib/modules/blockchain/blockchain-dal/writers/identity.rs b/lib/modules/blockchain/blockchain-dal/writers/identity.rs index 3a965464..fe9d9983 100644 --- a/lib/modules/blockchain/blockchain-dal/writers/identity.rs +++ b/lib/modules/blockchain/blockchain-dal/writers/identity.rs @@ -13,14 +13,14 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. -use currency_params::CurrencyParameters; +use crate::currency_params::CurrencyParameters; +use crate::identity::{DALIdentity, DALIdentityState}; +use crate::{BinDB, DALError, IdentitiesV10Datas, MsExpirV10Datas}; use dubp_documents::v10::identity::IdentityDocument; use dubp_documents::Document; use dubp_documents::{BlockId, Blockstamp}; use dup_crypto::keys::PubKey; use durs_wot::NodeId; -use identity::{DALIdentity, DALIdentityState}; -use {BinDB, DALError, IdentitiesV10Datas, MsExpirV10Datas}; /// Remove identity from databases pub fn revert_create_identity( diff --git a/lib/modules/blockchain/blockchain-dal/writers/requests.rs b/lib/modules/blockchain/blockchain-dal/writers/requests.rs index 73ecb83e..2ee202dc 100644 --- a/lib/modules/blockchain/blockchain-dal/writers/requests.rs +++ b/lib/modules/blockchain/blockchain-dal/writers/requests.rs @@ -13,18 +13,18 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. -use block::DALBlock; -use currency_params::CurrencyParameters; +use crate::block::DALBlock; +use crate::currency_params::CurrencyParameters; +use crate::identity::DALIdentity; +use crate::sources::SourceAmount; +use crate::writers::transaction::DALTxV10; +use crate::*; use dubp_documents::v10::certification::CompactCertificationDocument; use dubp_documents::v10::identity::IdentityDocument; use dubp_documents::Blockstamp; use dup_crypto::keys::PubKey; use durs_wot::NodeId; -use identity::DALIdentity; -use sources::SourceAmount; use std::ops::Deref; -use writers::transaction::DALTxV10; -use *; #[derive(Debug, Clone)] /// Contain a pending write request for databases diff --git a/lib/modules/blockchain/blockchain-dal/writers/transaction.rs b/lib/modules/blockchain/blockchain-dal/writers/transaction.rs index 9696d68d..338f0579 100644 --- a/lib/modules/blockchain/blockchain-dal/writers/transaction.rs +++ b/lib/modules/blockchain/blockchain-dal/writers/transaction.rs @@ -15,8 +15,8 @@ use dubp_documents::v10::transaction::*; -use sources::{SourceAmount, SourceIndexV10, UTXOIndexV10, UTXOV10}; -use *; +use crate::sources::{SourceAmount, SourceIndexV10, UTXOIndexV10, UTXOV10}; +use crate::*; #[derive(Debug, Copy, Clone)] /// Transaction error diff --git a/lib/modules/blockchain/blockchain/Cargo.toml b/lib/modules/blockchain/blockchain/Cargo.toml index a45de95c..c8bf0556 100644 --- a/lib/modules/blockchain/blockchain/Cargo.toml +++ b/lib/modules/blockchain/blockchain/Cargo.toml @@ -4,6 +4,7 @@ version = "0.1.0-a0.1" authors = ["librelois <elois@ifee.fr>"] description = "Blockchain module for the Durs project." license = "AGPL-3.0" +edition = "2018" [lib] path = "lib.rs" diff --git a/lib/modules/blockchain/blockchain/check_and_apply_block.rs b/lib/modules/blockchain/blockchain/check_and_apply_block.rs index 4c01613c..af4ee09e 100644 --- a/lib/modules/blockchain/blockchain/check_and_apply_block.rs +++ b/lib/modules/blockchain/blockchain/check_and_apply_block.rs @@ -15,14 +15,14 @@ use std::collections::HashMap; -use apply_valid_block::*; +use crate::apply_valid_block::*; +use crate::*; use dubp_documents::Document; use dubp_documents::{BlockHash, BlockId, Blockstamp, PreviousBlockstamp}; use duniter_network::documents::NetworkBlock; use dup_crypto::keys::*; use durs_blockchain_dal::block::DALBlock; use durs_blockchain_dal::*; -use *; #[derive(Debug, Copy, Clone)] pub enum BlockError { diff --git a/lib/modules/blockchain/blockchain/dbex.rs b/lib/modules/blockchain/blockchain/dbex.rs index 43cc0108..1a388f6c 100644 --- a/lib/modules/blockchain/blockchain/dbex.rs +++ b/lib/modules/blockchain/blockchain/dbex.rs @@ -13,6 +13,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. +use crate::*; use dubp_documents::v10::transaction::*; use duniter_module::DuniterConf; use dup_crypto::keys::*; @@ -20,7 +21,6 @@ use durs_blockchain_dal::identity::DALIdentity; use durs_wot::data::rusty::RustyWebOfTrust; use durs_wot::operations::distance::{DistanceCalculator, WotDistance, WotDistanceParameters}; use std::time::*; -use *; #[derive(Debug, Clone)] /// Query for wot databases explorer diff --git a/lib/modules/blockchain/blockchain/lib.rs b/lib/modules/blockchain/blockchain/lib.rs index d3db2de6..e97b7df4 100644 --- a/lib/modules/blockchain/blockchain/lib.rs +++ b/lib/modules/blockchain/blockchain/lib.rs @@ -59,9 +59,9 @@ use std::str; use std::sync::mpsc; use std::time::{Duration, SystemTime, UNIX_EPOCH}; -use apply_valid_block::*; -use check_and_apply_block::*; -pub use dbex::{DBExQuery, DBExTxQuery, DBExWotQuery}; +use crate::apply_valid_block::*; +use crate::check_and_apply_block::*; +pub use crate::dbex::{DBExQuery, DBExTxQuery, DBExWotQuery}; use dubp_documents::v10::{BlockDocument, V10Document}; use dubp_documents::*; use dubp_documents::{DUBPDocument, Document}; diff --git a/lib/modules/blockchain/blockchain/sync.rs b/lib/modules/blockchain/blockchain/sync.rs index 787cce69..802eb43a 100644 --- a/lib/modules/blockchain/blockchain/sync.rs +++ b/lib/modules/blockchain/blockchain/sync.rs @@ -20,6 +20,8 @@ extern crate threadpool; use self::pbr::ProgressBar; use self::threadpool::ThreadPool; +use crate::ts_parsers::*; +use crate::*; use dubp_documents::{BlockHash, BlockId}; use duniter_network::documents::NetworkBlock; use dup_crypto::hashs::Hash; @@ -34,8 +36,6 @@ use std::ops::Deref; use std::sync::mpsc; use std::thread; use std::time::SystemTime; -use ts_parsers::*; -use *; /// Number of sync jobs pub static NB_SYNC_JOBS: &'static usize = &4; diff --git a/lib/modules/blockchain/blockchain/ts_parsers.rs b/lib/modules/blockchain/blockchain/ts_parsers.rs index 8836d084..b5f6166b 100644 --- a/lib/modules/blockchain/blockchain/ts_parsers.rs +++ b/lib/modules/blockchain/blockchain/ts_parsers.rs @@ -16,6 +16,7 @@ extern crate serde_json; extern crate sqlite; +use crate::sync::BlockHeader; use dubp_documents::v10::block::{BlockV10Parameters, TxDocOrTxHash}; use dubp_documents::v10::identity::*; use dubp_documents::v10::membership::*; @@ -28,7 +29,6 @@ use duniter_network::documents::{NetworkBlock, NetworkBlockV10}; use dup_crypto::hashs::Hash; use dup_crypto::keys::*; use std::str::FromStr; -use sync::BlockHeader; #[derive(Debug, Copy, Clone, PartialEq, Eq)] /// MembershipParseError diff --git a/lib/modules/skeleton/Cargo.toml b/lib/modules/skeleton/Cargo.toml index a83af23f..5f039cb4 100644 --- a/lib/modules/skeleton/Cargo.toml +++ b/lib/modules/skeleton/Cargo.toml @@ -4,6 +4,7 @@ version = "0.1.0" authors = ["name <mail@domain.tld>"] description = "Module template to copy to create a new Durs module." license = "AGPL-3.0" +edition = "2018" [lib] path = "lib.rs" diff --git a/lib/modules/tui/Cargo.toml b/lib/modules/tui/Cargo.toml index c469074b..e4e8f731 100644 --- a/lib/modules/tui/Cargo.toml +++ b/lib/modules/tui/Cargo.toml @@ -4,6 +4,7 @@ version = "0.1.0-a0.1" authors = ["librelois <elois@ifee.fr>"] description = "Terminal user interface for Duniter-Rs." license = "AGPL-3.0" +edition = "2018" [lib] path = "lib.rs" diff --git a/lib/modules/ws2p-v1-legacy/Cargo.toml b/lib/modules/ws2p-v1-legacy/Cargo.toml index 8d5d0df7..3efeee12 100644 --- a/lib/modules/ws2p-v1-legacy/Cargo.toml +++ b/lib/modules/ws2p-v1-legacy/Cargo.toml @@ -4,6 +4,7 @@ version = "0.1.0-a0.1" authors = ["librelois <elois@ifee.fr>"] description = "WebSocketToPeer API for the Durs project." license = "AGPL-3.0" +edition = "2018" [lib] path = "lib.rs" diff --git a/lib/modules/ws2p-v1-legacy/datas.rs b/lib/modules/ws2p-v1-legacy/datas.rs index 34c4602e..4d468040 100644 --- a/lib/modules/ws2p-v1-legacy/datas.rs +++ b/lib/modules/ws2p-v1-legacy/datas.rs @@ -13,7 +13,8 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. -use constants::*; +use crate::constants::*; +use crate::*; use dubp_documents::Blockstamp; use duniter_network::*; use dup_crypto::keys::*; @@ -24,7 +25,6 @@ use durs_network_documents::network_head::*; use durs_network_documents::*; use std::collections::HashSet; use std::sync::mpsc; -use *; #[derive(Debug)] pub struct WS2PModuleDatas { @@ -129,7 +129,7 @@ impl WS2PModuleDatas { let blockstamps_occurences_copy = blockstamps_occurences.clone(); match blockstamps_occurences_copy.get(&head.blockstamp()) { Some(occurences) => { - let mut occurences_mut = blockstamps_occurences + let occurences_mut = blockstamps_occurences .get_mut(&head.blockstamp()) .expect("WS2P: Fail to get_mut blockstamps_occurences !"); *occurences_mut += 1; diff --git a/lib/modules/ws2p-v1-legacy/heads.rs b/lib/modules/ws2p-v1-legacy/heads.rs index 33349c89..209bf147 100644 --- a/lib/modules/ws2p-v1-legacy/heads.rs +++ b/lib/modules/ws2p-v1-legacy/heads.rs @@ -13,9 +13,9 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. +use crate::*; use dubp_documents::Blockstamp; use durs_network_documents::network_head_v2::*; -use *; pub fn generate_my_head( network_keypair: &KeyPairEnum, diff --git a/lib/modules/ws2p-v1-legacy/lib.rs b/lib/modules/ws2p-v1-legacy/lib.rs index d2c52768..ced1bf9a 100644 --- a/lib/modules/ws2p-v1-legacy/lib.rs +++ b/lib/modules/ws2p-v1-legacy/lib.rs @@ -60,10 +60,14 @@ pub mod ws2p_connection; pub mod ws2p_db; pub mod ws2p_requests; -use ack_message::WS2PAckMessageV1; -use connect_message::WS2PConnectMessageV1; -use constants::*; -use datas::*; +use crate::ack_message::WS2PAckMessageV1; +use crate::connect_message::WS2PConnectMessageV1; +use crate::constants::*; +use crate::datas::*; +use crate::ok_message::WS2POkMessageV1; +use crate::parsers::blocks::parse_json_block; +use crate::ws2p_connection::*; +use crate::ws2p_requests::network_request_to_json; use dubp_documents::Blockstamp; use duniter_conf::DuRsConf; use duniter_module::*; @@ -80,8 +84,6 @@ use durs_message::*; use durs_network_documents::network_endpoint::*; use durs_network_documents::network_head::*; use durs_network_documents::*; -use ok_message::WS2POkMessageV1; -use parsers::blocks::parse_json_block; use std::collections::HashMap; use std::ops::Deref; use std::path::PathBuf; @@ -89,8 +91,6 @@ use std::sync::mpsc; use std::thread; use std::time::{Duration, SystemTime, UNIX_EPOCH}; use ws::Message; -use ws2p_connection::*; -use ws2p_requests::network_request_to_json; #[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] /// WS2P Configuration diff --git a/lib/modules/ws2p-v1-legacy/ws2p_connection.rs b/lib/modules/ws2p-v1-legacy/ws2p_connection.rs index 3b85d048..9e9098a9 100644 --- a/lib/modules/ws2p-v1-legacy/ws2p_connection.rs +++ b/lib/modules/ws2p-v1-legacy/ws2p_connection.rs @@ -1,17 +1,17 @@ -use constants::*; +use crate::constants::*; +use crate::parsers::blocks::parse_json_block; +use crate::*; use duniter_module::ModuleReqId; use duniter_network::documents::BlockchainDocument; use dup_crypto::keys::*; use durs_network_documents::network_endpoint::{EndpointV1, NetworkEndpointApi}; use durs_network_documents::NodeId; -use parsers::blocks::parse_json_block; use rand::Rng; use std::sync::mpsc; use ws::deflate::DeflateBuilder; #[allow(deprecated)] use ws::util::{Timeout, Token}; use ws::{connect, CloseCode, Frame, Handler, Handshake, Message, Sender}; -use *; const CONNECT: Token = Token(1); const EXPIRE: Token = Token(2); diff --git a/lib/modules/ws2p/ws2p-messages/Cargo.toml b/lib/modules/ws2p/ws2p-messages/Cargo.toml index b6a259b6..92f0aefc 100644 --- a/lib/modules/ws2p/ws2p-messages/Cargo.toml +++ b/lib/modules/ws2p/ws2p-messages/Cargo.toml @@ -4,6 +4,7 @@ version = "0.1.0-a0.1" authors = ["librelois <elois@ifee.fr>"] description = "Handles WebSocketToPeer API Messages." license = "AGPL-3.0" +edition = "2018" [lib] path = "lib.rs" diff --git a/lib/modules/ws2p/ws2p-messages/lib.rs b/lib/modules/ws2p/ws2p-messages/lib.rs index 01c4a5c1..8248aa04 100644 --- a/lib/modules/ws2p/ws2p-messages/lib.rs +++ b/lib/modules/ws2p/ws2p-messages/lib.rs @@ -43,10 +43,10 @@ extern crate durs_network_documents; /// WS2Pv2 Messages pub mod v2; +use crate::v2::WS2Pv2Message; use dup_crypto::hashs::Hash; use dup_crypto::keys::bin_signable::BinSignable; use dup_crypto::keys::*; -use v2::WS2Pv2Message; #[derive(Debug, Clone, Eq, PartialEq, Serialize, Deserialize)] /// WS2Pv2Message @@ -152,6 +152,8 @@ impl<'de> BinSignable<'de> for WS2PMessage { #[cfg(test)] mod tests { + use crate::v2::payload_container::WS2Pv2MessagePayload; + use crate::v2::WS2Pv2Message; use bincode; use bincode::{deserialize, serialize}; use dubp_documents::v10::certification::*; @@ -163,8 +165,6 @@ mod tests { use durs_network_documents::*; use std::net::Ipv4Addr; use std::str::FromStr; - use v2::payload_container::WS2Pv2MessagePayload; - use v2::WS2Pv2Message; pub fn keypair1() -> ed25519::KeyPair { ed25519::KeyPairFromSaltedPasswordGenerator::with_default_parameters().generate( diff --git a/lib/modules/ws2p/ws2p-messages/v2/connect.rs b/lib/modules/ws2p/ws2p-messages/v2/connect.rs index 61f4cf08..71ce3d80 100644 --- a/lib/modules/ws2p/ws2p-messages/v2/connect.rs +++ b/lib/modules/ws2p/ws2p-messages/v2/connect.rs @@ -153,9 +153,9 @@ pub fn generate_connect_message( mod tests { use super::super::*; use super::*; + use crate::tests::*; use dubp_documents::Blockstamp; use dup_crypto::keys::text_signable::TextSignable; - use tests::*; #[test] fn test_ws2p_connect_flags() { diff --git a/lib/modules/ws2p/ws2p-messages/v2/mod.rs b/lib/modules/ws2p/ws2p-messages/v2/mod.rs index 3b68fda8..3b424c6b 100644 --- a/lib/modules/ws2p/ws2p-messages/v2/mod.rs +++ b/lib/modules/ws2p/ws2p-messages/v2/mod.rs @@ -28,13 +28,13 @@ pub mod requests; /// WS2P v2 SECRET_FLAGS Message pub mod secret_flags; +use crate::v2::payload_container::*; +use crate::WS2PMessage; use dubp_documents::CurrencyName; use dup_crypto::hashs::Hash; use dup_crypto::keys::bin_signable::BinSignable; use dup_crypto::keys::*; use durs_network_documents::NodeId; -use v2::payload_container::*; -use WS2PMessage; /// WS2P v2 message metadata size pub static WS2P_V2_MESSAGE_METADATA_SIZE: &'static usize = &144; @@ -106,8 +106,8 @@ impl<'de> BinSignable<'de> for WS2Pv2Message { #[cfg(test)] mod tests { use super::*; + use crate::tests::*; use dup_crypto::keys::text_signable::TextSignable; - use tests::*; #[test] fn test_ws2p_message_ack() { diff --git a/lib/modules/ws2p/ws2p-messages/v2/ok.rs b/lib/modules/ws2p/ws2p-messages/v2/ok.rs index a560ae6d..f0d13e22 100644 --- a/lib/modules/ws2p/ws2p-messages/v2/ok.rs +++ b/lib/modules/ws2p/ws2p-messages/v2/ok.rs @@ -48,9 +48,9 @@ pub struct WS2Pv2SyncTarget { mod tests { use super::super::*; use super::*; + use crate::tests::*; use dubp_documents::Blockstamp; use std::num::NonZeroU16; - use tests::*; #[test] fn test_ws2p_message_ok() { diff --git a/lib/modules/ws2p/ws2p-messages/v2/req_responses.rs b/lib/modules/ws2p/ws2p-messages/v2/req_responses.rs index 0e8d1e28..4013a219 100644 --- a/lib/modules/ws2p/ws2p-messages/v2/req_responses.rs +++ b/lib/modules/ws2p/ws2p-messages/v2/req_responses.rs @@ -62,8 +62,8 @@ pub struct WotPoolFolder { mod tests { use super::super::*; use super::*; + use crate::tests::*; use dubp_documents::Blockstamp; - use tests::*; #[test] fn test_ws2p_message_req_res_none() { diff --git a/lib/modules/ws2p/ws2p-messages/v2/requests.rs b/lib/modules/ws2p/ws2p-messages/v2/requests.rs index 7fbbd599..8a10db1a 100644 --- a/lib/modules/ws2p/ws2p-messages/v2/requests.rs +++ b/lib/modules/ws2p/ws2p-messages/v2/requests.rs @@ -74,8 +74,8 @@ impl WS2Pv2RequestBody { mod tests { use super::super::*; use super::*; + use crate::tests::*; use dubp_documents::Blockstamp; - use tests::*; #[test] fn test_ws2p_message_request() { diff --git a/lib/modules/ws2p/ws2p-messages/v2/secret_flags.rs b/lib/modules/ws2p/ws2p-messages/v2/secret_flags.rs index 997e465e..113dbce3 100644 --- a/lib/modules/ws2p/ws2p-messages/v2/secret_flags.rs +++ b/lib/modules/ws2p/ws2p-messages/v2/secret_flags.rs @@ -68,7 +68,7 @@ impl Default for WS2Pv2SecretFlagsMsg { mod tests { use super::super::*; use super::*; - use tests::*; + use crate::tests::*; #[test] fn test_ws2p_message_secret_flags() { diff --git a/lib/modules/ws2p/ws2p/Cargo.toml b/lib/modules/ws2p/ws2p/Cargo.toml index e2ecfdb7..ebf080dc 100644 --- a/lib/modules/ws2p/ws2p/Cargo.toml +++ b/lib/modules/ws2p/ws2p/Cargo.toml @@ -4,6 +4,7 @@ version = "0.1.0-a0.1" authors = ["librelois <elois@ifee.fr>"] description = "WebSocketToPeer API for DURS Project." license = "AGPL-3.0" +edition = "2018" [lib] path = "src/lib.rs" diff --git a/lib/modules/ws2p/ws2p/src/controllers/handler/connect_msg.rs b/lib/modules/ws2p/ws2p/src/controllers/handler/connect_msg.rs index 9fa04959..737d507b 100644 --- a/lib/modules/ws2p/ws2p/src/controllers/handler/connect_msg.rs +++ b/lib/modules/ws2p/ws2p/src/controllers/handler/connect_msg.rs @@ -15,9 +15,9 @@ //! Process WS2P CONNECT mesage. -use controllers::handler::*; -use controllers::ws::CloseCode; -use controllers::*; +use crate::controllers::handler::*; +use crate::controllers::ws::CloseCode; +use crate::controllers::*; use durs_network_documents::NodeFullId; use durs_ws2p_messages::v2::connect::WS2Pv2ConnectMsg; //use services::Ws2pServiceSender; diff --git a/lib/modules/ws2p/ws2p/src/controllers/handler/mod.rs b/lib/modules/ws2p/ws2p/src/controllers/handler/mod.rs index dadff733..3291df55 100644 --- a/lib/modules/ws2p/ws2p/src/controllers/handler/mod.rs +++ b/lib/modules/ws2p/ws2p/src/controllers/handler/mod.rs @@ -19,19 +19,19 @@ pub mod connect_msg; extern crate serde_json; -use constants::*; -use controllers::ws::{util::Token, CloseCode, /*Frame,*/ Handler, Handshake, Message}; -use controllers::*; -use services::*; +use crate::constants::*; +use crate::controllers::ws::{util::Token, CloseCode, /*Frame,*/ Handler, Handshake, Message}; +use crate::controllers::*; +use crate::services::*; //use dup_crypto::keys::KeyPairEnum; use dubp_documents::CurrencyName; use durs_network_documents::NodeFullId; //use durs_ws2p_messages::v2::api_features::WS2PFeatures; +use crate::services::Ws2pServiceSender; use durs_ws2p_messages::v2::connect::generate_connect_message; use durs_ws2p_messages::v2::payload_container::WS2Pv2MessagePayload; use durs_ws2p_messages::v2::WS2Pv2Message; use durs_ws2p_messages::WS2PMessage; -use services::Ws2pServiceSender; use std::net::SocketAddr; use std::ops::Deref; use std::sync::mpsc; diff --git a/lib/modules/ws2p/ws2p/src/controllers/incoming_connections/mod.rs b/lib/modules/ws2p/ws2p/src/controllers/incoming_connections/mod.rs index 4a661480..0113d676 100644 --- a/lib/modules/ws2p/ws2p/src/controllers/incoming_connections/mod.rs +++ b/lib/modules/ws2p/ws2p/src/controllers/incoming_connections/mod.rs @@ -17,11 +17,11 @@ use dubp_documents::CurrencyName; //use duniter_module::ModuleReqId; -use controllers::handler::Ws2pConnectionHandler; -use controllers::ws::deflate::DeflateBuilder; -use controllers::ws::listen; -use controllers::*; -use services::*; +use crate::controllers::handler::Ws2pConnectionHandler; +use crate::controllers::ws::deflate::DeflateBuilder; +use crate::controllers::ws::listen; +use crate::controllers::*; +use crate::services::*; //use duniter_network::*; use durs_ws2p_messages::v2::connect::WS2Pv2ConnectType; use std::sync::mpsc; diff --git a/lib/modules/ws2p/ws2p/src/controllers/outgoing_connections/mod.rs b/lib/modules/ws2p/ws2p/src/controllers/outgoing_connections/mod.rs index 9f7f13eb..5247ac2d 100644 --- a/lib/modules/ws2p/ws2p/src/controllers/outgoing_connections/mod.rs +++ b/lib/modules/ws2p/ws2p/src/controllers/outgoing_connections/mod.rs @@ -17,13 +17,13 @@ use dubp_documents::CurrencyName; //use duniter_module::ModuleReqId; -use controllers::handler::Ws2pConnectionHandler; -use controllers::ws::connect; -use controllers::ws::deflate::DeflateBuilder; -use controllers::*; +use crate::controllers::handler::Ws2pConnectionHandler; +use crate::controllers::ws::connect; +use crate::controllers::ws::deflate::DeflateBuilder; +use crate::controllers::*; +use crate::services::*; use durs_network_documents::network_endpoint::EndpointEnum; use durs_network_documents::NodeFullId; -use services::*; //use duniter_network::*; use durs_ws2p_messages::v2::connect::WS2Pv2ConnectType; use std::sync::mpsc; diff --git a/lib/modules/ws2p/ws2p/src/lib.rs b/lib/modules/ws2p/ws2p/src/lib.rs index e50e3121..42c049b0 100644 --- a/lib/modules/ws2p/ws2p/src/lib.rs +++ b/lib/modules/ws2p/ws2p/src/lib.rs @@ -49,7 +49,7 @@ pub mod controllers; mod generate_peer; pub mod services; -use constants::*; +use crate::constants::*; use duniter_conf::DuRsConf; use duniter_module::*; use duniter_network::cli::sync::SyncOpt; diff --git a/lib/modules/ws2p/ws2p/src/services/mod.rs b/lib/modules/ws2p/ws2p/src/services/mod.rs index cad9613b..3e8dd8f2 100644 --- a/lib/modules/ws2p/ws2p/src/services/mod.rs +++ b/lib/modules/ws2p/ws2p/src/services/mod.rs @@ -15,7 +15,7 @@ //! WS2P Services -use controllers::*; +use crate::controllers::*; use duniter_network::documents::BlockchainDocument; use dup_crypto::keys::KeyPairEnum; use durs_network_documents::network_head::NetworkHead; diff --git a/lib/modules/ws2p/ws2p/src/services/outgoing.rs b/lib/modules/ws2p/ws2p/src/services/outgoing.rs index ed671150..88be87d4 100644 --- a/lib/modules/ws2p/ws2p/src/services/outgoing.rs +++ b/lib/modules/ws2p/ws2p/src/services/outgoing.rs @@ -15,12 +15,12 @@ //! WS2P outgoing Services +use crate::services::*; +use crate::*; use dubp_documents::CurrencyName; use durs_network_documents::NodeFullId; -use services::*; use std::collections::HashMap; use std::sync::mpsc; -use *; #[derive(Debug, Clone)] /// Data allowing the service to manage an outgoing connection diff --git a/lib/tools/crypto/Cargo.toml b/lib/tools/crypto/Cargo.toml index 6347d17c..530dddd8 100644 --- a/lib/tools/crypto/Cargo.toml +++ b/lib/tools/crypto/Cargo.toml @@ -7,6 +7,7 @@ repository = "https://git.duniter.org/nodes/rust/duniter-rs" readme = "README.md" keywords = ["duniter", "keys", "cryptography"] license = "AGPL-3.0" +edition = "2018" [lib] path = "src/lib.rs" diff --git a/lib/tools/crypto/src/hashs/mod.rs b/lib/tools/crypto/src/hashs/mod.rs index 8b2c580a..bb1906b8 100644 --- a/lib/tools/crypto/src/hashs/mod.rs +++ b/lib/tools/crypto/src/hashs/mod.rs @@ -15,9 +15,9 @@ //! Provide wrappers for cryptographic hashs +use crate::keys::BaseConvertionError; use crypto::digest::Digest; use crypto::sha2::Sha256; -use keys::BaseConvertionError; use rand::{thread_rng, Rng}; use std::fmt::{Debug, Display, Error, Formatter}; diff --git a/lib/tools/crypto/src/keys/bin_signable.rs b/lib/tools/crypto/src/keys/bin_signable.rs index 40d2055b..8cbd13d3 100644 --- a/lib/tools/crypto/src/keys/bin_signable.rs +++ b/lib/tools/crypto/src/keys/bin_signable.rs @@ -16,8 +16,8 @@ //! Generic code for signing data in binary format use super::*; +use crate::hashs::Hash; use bincode; -use hashs::Hash; use serde::{Deserialize, Serialize}; /// Signatureable in binary format diff --git a/lib/tools/crypto/src/keys/ed25519.rs b/lib/tools/crypto/src/keys/ed25519.rs index cae348d9..64137cdb 100644 --- a/lib/tools/crypto/src/keys/ed25519.rs +++ b/lib/tools/crypto/src/keys/ed25519.rs @@ -384,7 +384,7 @@ impl KeyPairFromSaltedPasswordGenerator { #[cfg(test)] mod tests { use super::*; - use keys::{KeyPair, Signature}; + use crate::keys::{KeyPair, Signature}; #[test] fn base58_private_key() { diff --git a/lib/tools/documents/Cargo.toml b/lib/tools/documents/Cargo.toml index 405cf083..95f2c1dd 100644 --- a/lib/tools/documents/Cargo.toml +++ b/lib/tools/documents/Cargo.toml @@ -7,6 +7,7 @@ repository = "https://git.duniter.org/nodes/rust/duniter-rs" readme = "README.md" keywords = ["duniter", "blockchain", "cryptocurrency", "document"] license = "AGPL-3.0" +edition = "2018" [lib] path = "src/lib.rs" diff --git a/lib/tools/documents/src/blockstamp.rs b/lib/tools/documents/src/blockstamp.rs index a81d70af..f800178e 100644 --- a/lib/tools/documents/src/blockstamp.rs +++ b/lib/tools/documents/src/blockstamp.rs @@ -15,7 +15,7 @@ //! Wrapper for blockstamp -use *; +use crate::*; /// Type of errors for [`BlockUId`] parsing. /// diff --git a/lib/tools/documents/src/lib.rs b/lib/tools/documents/src/lib.rs index dbb8d5f6..0a7e1a5a 100644 --- a/lib/tools/documents/src/lib.rs +++ b/lib/tools/documents/src/lib.rs @@ -45,8 +45,8 @@ pub mod blockstamp; mod currencies_codes; pub mod v10; +use crate::currencies_codes::*; use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt}; -use currencies_codes::*; use dup_crypto::hashs::Hash; use dup_crypto::keys::*; use pest::iterators::Pair; @@ -57,7 +57,7 @@ use std::fmt::{Debug, Display, Error, Formatter}; use std::io::Cursor; use std::mem; -pub use blockstamp::{Blockstamp, PreviousBlockstamp}; +pub use crate::blockstamp::{Blockstamp, PreviousBlockstamp}; #[derive(Parser)] #[grammar = "documents_grammar.pest"] diff --git a/lib/tools/documents/src/v10/block.rs b/lib/tools/documents/src/v10/block.rs index 2a53d4ea..fcb30e62 100644 --- a/lib/tools/documents/src/v10/block.rs +++ b/lib/tools/documents/src/v10/block.rs @@ -19,14 +19,14 @@ use dup_crypto::hashs::Hash; use dup_crypto::keys::*; use std::ops::Deref; -use blockstamp::Blockstamp; -use v10::certification::CertificationDocument; -use v10::identity::IdentityDocument; -use v10::membership::MembershipDocument; -use v10::revocation::RevocationDocument; -use v10::transaction::TransactionDocument; -use v10::*; -use *; +use crate::blockstamp::Blockstamp; +use crate::v10::certification::CertificationDocument; +use crate::v10::identity::IdentityDocument; +use crate::v10::membership::MembershipDocument; +use crate::v10::revocation::RevocationDocument; +use crate::v10::transaction::TransactionDocument; +use crate::v10::*; +use crate::*; #[derive(Debug, Clone)] /// Store error in block parameters parsing @@ -505,7 +505,7 @@ mod tests { use super::certification::CertificationDocumentParser; use super::transaction::TransactionDocumentParser; use super::*; - use {Document, VerificationResult}; + use crate::{Document, VerificationResult}; #[test] fn generate_and_verify_empty_block() { diff --git a/lib/tools/documents/src/v10/certification.rs b/lib/tools/documents/src/v10/certification.rs index bb81effb..de874e0a 100644 --- a/lib/tools/documents/src/v10/certification.rs +++ b/lib/tools/documents/src/v10/certification.rs @@ -18,9 +18,9 @@ use dup_crypto::keys::*; use pest::Parser; -use blockstamp::Blockstamp; -use v10::*; -use *; +use crate::blockstamp::Blockstamp; +use crate::v10::*; +use crate::*; #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] /// Wrap an Compact Revocation document (in block content) @@ -331,8 +331,8 @@ impl TextDocumentParser<Rule> for CertificationDocumentParser { #[cfg(test)] mod tests { use super::*; + use crate::VerificationResult; use dup_crypto::keys::{PrivateKey, PublicKey, Signature}; - use VerificationResult; #[test] fn generate_real_document() { diff --git a/lib/tools/documents/src/v10/identity.rs b/lib/tools/documents/src/v10/identity.rs index ff28eb7e..503e44f2 100644 --- a/lib/tools/documents/src/v10/identity.rs +++ b/lib/tools/documents/src/v10/identity.rs @@ -17,9 +17,9 @@ use pest::Parser; -use v10::*; -use Blockstamp; -use *; +use crate::v10::*; +use crate::Blockstamp; +use crate::*; /// Wrap an Identity document. /// @@ -234,8 +234,8 @@ impl TextDocumentParser<Rule> for IdentityDocumentParser { fn parse(doc: &str) -> Result<Self::DocumentType, TextDocumentParseError> { match DocumentsParser::parse(Rule::idty, doc) { Ok(mut doc_pairs) => { - let mut idty_pair = doc_pairs.next().unwrap(); // get and unwrap the `idty` rule; never fails - let mut idty_vx_pair = idty_pair.into_inner().next().unwrap(); // get and unwrap the `idty_vx` rule; never fails + let idty_pair = doc_pairs.next().unwrap(); // get and unwrap the `idty` rule; never fails + let idty_vx_pair = idty_pair.into_inner().next().unwrap(); // get and unwrap the `idty_vx` rule; never fails match idty_vx_pair.as_rule() { Rule::idty_v10 => Ok(IdentityDocumentParser::from_pest_pair(idty_vx_pair)), @@ -293,8 +293,8 @@ impl TextDocumentParser<Rule> for IdentityDocumentParser { #[cfg(test)] mod tests { use super::*; + use crate::{Document, VerificationResult}; use dup_crypto::keys::{PrivateKey, PublicKey, Signature}; - use {Document, VerificationResult}; #[test] fn generate_real_document() { diff --git a/lib/tools/documents/src/v10/membership.rs b/lib/tools/documents/src/v10/membership.rs index 1c44b0cd..47c4f017 100644 --- a/lib/tools/documents/src/v10/membership.rs +++ b/lib/tools/documents/src/v10/membership.rs @@ -18,9 +18,9 @@ use dup_crypto::keys::*; use pest::Parser; -use blockstamp::Blockstamp; -use v10::*; -use *; +use crate::blockstamp::Blockstamp; +use crate::v10::*; +use crate::*; /// Type of a Membership. #[derive(Debug, Deserialize, Clone, Copy, Hash, Serialize, PartialEq, Eq)] @@ -358,8 +358,8 @@ impl TextDocumentParser<Rule> for MembershipDocumentParser { #[cfg(test)] mod tests { use super::*; + use crate::VerificationResult; use dup_crypto::keys::{PrivateKey, PublicKey, Signature}; - use VerificationResult; #[test] fn generate_real_document() { diff --git a/lib/tools/documents/src/v10/mod.rs b/lib/tools/documents/src/v10/mod.rs index bc61eaa2..bf96fd99 100644 --- a/lib/tools/documents/src/v10/mod.rs +++ b/lib/tools/documents/src/v10/mod.rs @@ -25,14 +25,14 @@ pub mod transaction; use dup_crypto::keys::PrivateKey; use pest::Parser; -pub use v10::block::BlockDocument; -use v10::certification::*; -use v10::identity::*; -use v10::membership::*; -use v10::revocation::*; -use v10::transaction::*; -use ToStringObject; -use *; +pub use crate::v10::block::BlockDocument; +use crate::v10::certification::*; +use crate::v10::identity::*; +use crate::v10::membership::*; +use crate::v10::revocation::*; +use crate::v10::transaction::*; +use crate::ToStringObject; +use crate::*; #[derive(Clone, Debug, Deserialize, Serialize)] /// Contains a document in full or compact format diff --git a/lib/tools/documents/src/v10/revocation.rs b/lib/tools/documents/src/v10/revocation.rs index c070a49c..cd98ea22 100644 --- a/lib/tools/documents/src/v10/revocation.rs +++ b/lib/tools/documents/src/v10/revocation.rs @@ -18,9 +18,9 @@ use dup_crypto::keys::*; use pest::Parser; -use blockstamp::Blockstamp; -use v10::*; -use *; +use crate::blockstamp::Blockstamp; +use crate::v10::*; +use crate::*; #[derive(Debug, Copy, Clone, Deserialize, Serialize, PartialEq, Eq)] /// Wrap an Compact Revocation document (in block content) @@ -291,8 +291,8 @@ impl TextDocumentParser<Rule> for RevocationDocumentParser { #[cfg(test)] mod tests { use super::*; + use crate::VerificationResult; use dup_crypto::keys::{PrivateKey, PublicKey, Signature}; - use VerificationResult; #[test] fn generate_real_document() { diff --git a/lib/tools/documents/src/v10/transaction.rs b/lib/tools/documents/src/v10/transaction.rs index fe61bca1..d56f5793 100644 --- a/lib/tools/documents/src/v10/transaction.rs +++ b/lib/tools/documents/src/v10/transaction.rs @@ -22,9 +22,9 @@ use pest::Parser; use std::ops::{Add, Deref, Sub}; use std::str::FromStr; -use blockstamp::Blockstamp; -use v10::*; -use *; +use crate::blockstamp::Blockstamp; +use crate::v10::*; +use crate::*; /// Wrap a transaction amount #[derive(Debug, Copy, Clone, Eq, Ord, PartialEq, PartialOrd, Deserialize, Hash, Serialize)] @@ -352,7 +352,7 @@ impl UTXOConditionsGroup { pub fn wrap_utxo_conds(pair: Pair<Rule>) -> UTXOConditionsGroup { match pair.as_rule() { Rule::output_and_group => { - let mut and_pairs = pair.into_inner(); + let and_pairs = pair.into_inner(); let mut conds_subgroups: Vec<UTXOConditionsGroup> = and_pairs .map(UTXOConditionsGroup::wrap_utxo_conds) .collect(); @@ -361,7 +361,7 @@ impl UTXOConditionsGroup { ))) } Rule::output_or_group => { - let mut or_pairs = pair.into_inner(); + let or_pairs = pair.into_inner(); let mut conds_subgroups: Vec<UTXOConditionsGroup> = or_pairs.map(UTXOConditionsGroup::wrap_utxo_conds).collect(); UTXOConditionsGroup::Brackets(Box::new(UTXOConditionsGroup::new_or_chain( @@ -903,7 +903,7 @@ impl TextDocumentParser<Rule> for TransactionDocumentParser { #[cfg(test)] mod tests { use super::*; - use {Document, VerificationResult}; + use crate::{Document, VerificationResult}; #[test] fn generate_real_document() { diff --git a/lib/tools/network-documents/Cargo.toml b/lib/tools/network-documents/Cargo.toml index 9149de41..280664eb 100644 --- a/lib/tools/network-documents/Cargo.toml +++ b/lib/tools/network-documents/Cargo.toml @@ -4,6 +4,7 @@ version = "0.3.0" authors = ["librelois <elois@duniter.org>"] description = "Network documents for DUNP (DUniter Network Protocol)" license = "AGPL-3.0" +edition = "2018" [lib] path = "src/lib.rs" diff --git a/lib/tools/network-documents/src/lib.rs b/lib/tools/network-documents/src/lib.rs index d9a04401..397cfe23 100644 --- a/lib/tools/network-documents/src/lib.rs +++ b/lib/tools/network-documents/src/lib.rs @@ -47,13 +47,13 @@ pub mod network_head_v2; pub mod network_head_v3; pub mod network_peer; +use crate::network_head::NetworkHead; +use crate::network_head_v3::NetworkHeadV3; +use crate::network_peer::PeerCard; +use crate::network_peer::PeerCardV11; use dubp_documents::{TextDocumentParseError, TextDocumentParser}; use dup_crypto::hashs::*; use dup_crypto::keys::*; -use network_head::NetworkHead; -use network_head_v3::NetworkHeadV3; -use network_peer::PeerCard; -use network_peer::PeerCardV11; use pest::iterators::Pair; use pest::Parser; use std::fmt::{Display, Error, Formatter}; diff --git a/lib/tools/network-documents/src/network_endpoint.rs b/lib/tools/network-documents/src/network_endpoint.rs index 155badfa..4c76f5ba 100644 --- a/lib/tools/network-documents/src/network_endpoint.rs +++ b/lib/tools/network-documents/src/network_endpoint.rs @@ -19,6 +19,7 @@ extern crate dubp_documents; extern crate dup_crypto; extern crate serde; +use crate::*; use dup_crypto::hashs::Hash; use dup_crypto::keys::PubKey; use hex; @@ -26,7 +27,6 @@ use pest::iterators::Pair; use pest::Parser; use std::net::{Ipv4Addr, Ipv6Addr}; use std::str::FromStr; -use *; /// Total size of all fixed size fields of an EndpointV2 pub static ENDPOINTV2_FIXED_SIZE: &'static usize = &9; @@ -513,7 +513,7 @@ impl EndpointEnum { #[cfg(test)] mod tests { use super::*; - use tests::bincode::{deserialize, serialize}; + use crate::tests::bincode::{deserialize, serialize}; #[test] fn test_network_features() { diff --git a/lib/tools/network-documents/src/network_head.rs b/lib/tools/network-documents/src/network_head.rs index 78efe08c..6a26fda9 100644 --- a/lib/tools/network-documents/src/network_head.rs +++ b/lib/tools/network-documents/src/network_head.rs @@ -15,16 +15,16 @@ //! Module defining the format of network heads and how to handle them. +use crate::network_head_v2::*; +use crate::network_head_v3::*; +use crate::{NodeFullId, NodeId}; use dubp_documents::blockstamp::*; use dup_crypto::keys::*; -use network_head_v2::*; -use network_head_v3::*; use serde_json; use std::collections::HashMap; use std::num::ParseIntError; use std::ops::Deref; use std::str::FromStr; -use {NodeFullId, NodeId}; #[derive(Debug, Clone, Eq, Ord, PartialOrd, PartialEq, Serialize, Deserialize)] /// Network Head : Set of information on the current state of a node, the central information being the blockstamp of its current block (= the head of its blockchain). diff --git a/lib/tools/network-documents/src/network_head_v2.rs b/lib/tools/network-documents/src/network_head_v2.rs index 5b9c72c8..662d116b 100644 --- a/lib/tools/network-documents/src/network_head_v2.rs +++ b/lib/tools/network-documents/src/network_head_v2.rs @@ -15,13 +15,13 @@ //! Module defining the format of network heads v2 and how to handle them. +use crate::NodeId; use dubp_documents::blockstamp::*; use dup_crypto::keys::*; use std::cmp::Ordering; use std::num::ParseIntError; use std::ops::Deref; use std::str::FromStr; -use NodeId; #[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] /// Head Message V2 diff --git a/lib/tools/network-documents/src/network_head_v3.rs b/lib/tools/network-documents/src/network_head_v3.rs index bb8be85b..53b2e2b0 100644 --- a/lib/tools/network-documents/src/network_head_v3.rs +++ b/lib/tools/network-documents/src/network_head_v3.rs @@ -15,6 +15,7 @@ //! Module defining the format of network heads v3 and how to handle them. +use crate::*; use base58::ToBase58; use dubp_documents::blockstamp::Blockstamp; use dubp_documents::{BlockHash, BlockId, CurrencyName, ToStringObject}; @@ -23,7 +24,6 @@ use dup_crypto::keys::*; use pest::iterators::Pair; use pest::Parser; use std::cmp::Ordering; -use *; #[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] /// Head V3 @@ -215,7 +215,7 @@ impl<'a> ToStringObject for NetworkHeadV3 { #[cfg(test)] mod tests { use super::*; - use tests::keypair1; + use crate::tests::keypair1; #[test] fn head_v3_sign_and_verify() { diff --git a/lib/tools/network-documents/src/network_peer.rs b/lib/tools/network-documents/src/network_peer.rs index c4b93afa..63ee3f38 100644 --- a/lib/tools/network-documents/src/network_peer.rs +++ b/lib/tools/network-documents/src/network_peer.rs @@ -19,16 +19,16 @@ extern crate dubp_documents; extern crate dup_crypto; extern crate serde; +use crate::network_endpoint::*; +use crate::*; use base58::ToBase58; use dubp_documents::ToStringObject; use dubp_documents::{blockstamp::Blockstamp, CurrencyName}; use dubp_documents::{BlockHash, BlockId}; use dup_crypto::keys::text_signable::TextSignable; use dup_crypto::keys::*; -use network_endpoint::*; use pest::iterators::Pair; use pest::Parser; -use *; #[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] /// Peer card V10 @@ -272,9 +272,9 @@ impl PeerCard { #[cfg(test)] mod tests { use super::*; + use crate::tests::keypair1; use std::net::Ipv4Addr; use std::str::FromStr; - use tests::keypair1; fn create_endpoint_v2() -> EndpointV2 { EndpointV2 { diff --git a/lib/tools/wot/Cargo.toml b/lib/tools/wot/Cargo.toml index e30866df..ce1992f5 100644 --- a/lib/tools/wot/Cargo.toml +++ b/lib/tools/wot/Cargo.toml @@ -7,6 +7,7 @@ repository = "https://git.duniter.org/nodes/rust/duniter-rs" readme = "README.md" keywords = ["duniter", "wot", "wot", "web", "trust"] license = "AGPL-3.0" +edition = "2018" [lib] path = "lib.rs" diff --git a/lib/tools/wot/data/rusty.rs b/lib/tools/wot/data/rusty.rs index 33090225..b3bbae06 100644 --- a/lib/tools/wot/data/rusty.rs +++ b/lib/tools/wot/data/rusty.rs @@ -16,10 +16,10 @@ //! Experimental implementation of the Web of Trust in a more "rusty" style. use super::{HasLinkResult, NewLinkResult, RemLinkResult}; +use crate::NodeId; +use crate::WebOfTrust; use rayon::prelude::*; use std::collections::HashSet; -use NodeId; -use WebOfTrust; /// A node in the `WoT` graph. #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] @@ -219,7 +219,7 @@ impl WebOfTrust for RustyWebOfTrust { #[cfg(test)] mod tests { use super::*; - use tests::generic_wot_test; + use crate::tests::generic_wot_test; #[test] fn wot_tests() { diff --git a/lib/tools/wot/lib.rs b/lib/tools/wot/lib.rs index 669613ce..cd53b1f3 100644 --- a/lib/tools/wot/lib.rs +++ b/lib/tools/wot/lib.rs @@ -49,16 +49,16 @@ extern crate serde_derive; pub mod data; pub mod operations; -pub use data::{NodeId, WebOfTrust}; +pub use crate::data::{NodeId, WebOfTrust}; #[cfg(test)] mod tests { use super::*; - use data::*; - use operations::centrality::*; - use operations::distance::*; - use operations::file::*; - use operations::path::*; + use crate::data::*; + use crate::operations::centrality::*; + use crate::operations::distance::*; + use crate::operations::file::*; + use crate::operations::path::*; /// Test translated from https://github.com/duniter/wot/blob/master/tests/test.js /// diff --git a/lib/tools/wot/operations/centrality.rs b/lib/tools/wot/operations/centrality.rs index c4470a82..c87b5f77 100644 --- a/lib/tools/wot/operations/centrality.rs +++ b/lib/tools/wot/operations/centrality.rs @@ -15,8 +15,8 @@ //! Provide a trait and implementations to find paths between nodes. -use data::NodeId; -use data::WebOfTrust; +use crate::data::NodeId; +use crate::data::WebOfTrust; use std::collections::{HashMap, VecDeque}; /// Find paths between 2 nodes of a `WebOfTrust`. diff --git a/lib/tools/wot/operations/distance.rs b/lib/tools/wot/operations/distance.rs index 46949ad2..d7e15768 100644 --- a/lib/tools/wot/operations/distance.rs +++ b/lib/tools/wot/operations/distance.rs @@ -15,8 +15,8 @@ //! Provide a trait and implementations to compute distances. -use data::NodeId; -use data::WebOfTrust; +use crate::data::NodeId; +use crate::data::WebOfTrust; use rayon::prelude::*; use std::collections::HashSet; diff --git a/lib/tools/wot/operations/file.rs b/lib/tools/wot/operations/file.rs index 785cf784..6561c128 100644 --- a/lib/tools/wot/operations/file.rs +++ b/lib/tools/wot/operations/file.rs @@ -15,7 +15,7 @@ //! Provide a trait and implementation to read and write `WebOfTrust` to disk. -use data::NodeId; +use crate::data::NodeId; use std::fs; use std::fs::File; use std::io; @@ -23,7 +23,7 @@ use std::io::prelude::*; use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt}; -use data::WebOfTrust; +use crate::data::WebOfTrust; /// Results of `WebOfTrust` parsing from binary file. #[derive(Debug)] diff --git a/lib/tools/wot/operations/path.rs b/lib/tools/wot/operations/path.rs index 5e3d2425..231af688 100644 --- a/lib/tools/wot/operations/path.rs +++ b/lib/tools/wot/operations/path.rs @@ -15,8 +15,8 @@ //! Provide a trait and implementations to find paths between nodes. -use data::NodeId; -use data::WebOfTrust; +use crate::data::NodeId; +use crate::data::WebOfTrust; use std::collections::HashSet; /// Find paths between 2 nodes of a `WebOfTrust`. -- GitLab