Skip to content
Snippets Groups Projects
Commit 82d5942b authored by dvermd's avatar dvermd
Browse files

[fix] ws2p: #134 remove unwrap and deny its use

parent 4f43bdd8
No related branches found
No related tags found
1 merge request!244Resolve "Reliability: remove all "unwrap()" and deny their use"
...@@ -1256,6 +1256,7 @@ dependencies = [ ...@@ -1256,6 +1256,7 @@ dependencies = [
"serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)",
"structopt 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "structopt 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
"unwrap 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"ws 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "ws 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
......
...@@ -30,6 +30,7 @@ serde = "1.0.*" ...@@ -30,6 +30,7 @@ serde = "1.0.*"
serde_derive = "1.0.*" serde_derive = "1.0.*"
serde_json = "1.0.*" serde_json = "1.0.*"
structopt= "0.3.4" structopt= "0.3.4"
unwrap = "1.2.1"
ws = { version = "0.9.*", features = ["permessage-deflate"] } ws = { version = "0.9.*", features = ["permessage-deflate"] }
[dev-dependencies] [dev-dependencies]
......
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
//! WebSocketToPeer API for the Duniter project. //! WebSocketToPeer API for the Duniter project.
#![deny( #![deny(
clippy::option_unwrap_used,
clippy::result_unwrap_used,
missing_docs, missing_docs,
missing_debug_implementations, missing_debug_implementations,
missing_copy_implementations, missing_copy_implementations,
...@@ -51,6 +53,7 @@ use durs_network::*; ...@@ -51,6 +53,7 @@ use durs_network::*;
use durs_network_documents::network_endpoint::*; use durs_network_documents::network_endpoint::*;
use maplit::hashset; use maplit::hashset;
use std::sync::mpsc; use std::sync::mpsc;
use unwrap::unwrap;
#[derive(Debug, Clone, PartialEq, Eq, Hash)] #[derive(Debug, Clone, PartialEq, Eq, Hash)]
/// WS2P Configuration /// WS2P Configuration
...@@ -84,8 +87,12 @@ impl Default for WS2PConf { ...@@ -84,8 +87,12 @@ impl Default for WS2PConf {
WS2PConf { WS2PConf {
outcoming_quota: *constants::WS2P_DEFAULT_OUTCOMING_QUOTA, outcoming_quota: *constants::WS2P_DEFAULT_OUTCOMING_QUOTA,
sync_endpoints: vec![ sync_endpoints: vec![
EndpointV2::parse_from_raw("WS2P 2 g1.dunitrust.org 443 ws2p").unwrap(), unwrap!(EndpointV2::parse_from_raw(
EndpointV2::parse_from_raw("WS2P 2 rs.g1.librelois.fr 443 ws2p").unwrap(), "WS2P 2 g1.dunitrust.org 443 ws2p"
)),
unwrap!(EndpointV2::parse_from_raw(
"WS2P 2 rs.g1.librelois.fr 443 ws2p"
)),
], ],
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment