cli-config: Ovf in ws port calculation
This commit is contained in:
parent
193e370186
commit
66b4124a68
|
@ -75,7 +75,8 @@ impl Config {
|
||||||
.set_scheme(if is_secure { "wss" } else { "ws" })
|
.set_scheme(if is_secure { "wss" } else { "ws" })
|
||||||
.expect("unable to set scheme");
|
.expect("unable to set scheme");
|
||||||
if let Some(port) = json_rpc_url.port() {
|
if let Some(port) = json_rpc_url.port() {
|
||||||
ws_url.set_port(Some(port + 1)).expect("unable to set port");
|
let port = port.checked_add(1).expect("port out of range");
|
||||||
|
ws_url.set_port(Some(port)).expect("unable to set port");
|
||||||
}
|
}
|
||||||
ws_url.to_string()
|
ws_url.to_string()
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
#![allow(clippy::integer_arithmetic)]
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate lazy_static;
|
extern crate lazy_static;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue