diff --git a/cli-config/src/config.rs b/cli-config/src/config.rs index b4d0b4597..ce7d02629 100644 --- a/cli-config/src/config.rs +++ b/cli-config/src/config.rs @@ -75,7 +75,8 @@ impl Config { .set_scheme(if is_secure { "wss" } else { "ws" }) .expect("unable to set scheme"); 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() } diff --git a/cli-config/src/lib.rs b/cli-config/src/lib.rs index 32ad0f38f..435e9762c 100644 --- a/cli-config/src/lib.rs +++ b/cli-config/src/lib.rs @@ -1,4 +1,3 @@ -#![allow(clippy::integer_arithmetic)] #[macro_use] extern crate lazy_static;