Commit c3219f6a authored by Éloïs's avatar Éloïs

[style] fix clippy warning : new() must return Self

parent ff501f44
...@@ -65,7 +65,7 @@ pub struct Ws2pConnectionHandler { ...@@ -65,7 +65,7 @@ pub struct Ws2pConnectionHandler {
impl Ws2pConnectionHandler { impl Ws2pConnectionHandler {
/// Instantiate new Ws2pConnectionHandler /// Instantiate new Ws2pConnectionHandler
pub fn new( pub fn try_new(
ws: WsSender, ws: WsSender,
service_sender: mpsc::Sender<Ws2pServiceSender>, service_sender: mpsc::Sender<Ws2pServiceSender>,
currency: CurrencyName, currency: CurrencyName,
......
...@@ -45,7 +45,7 @@ pub fn listen_on_ws2p_v2_endpoint( ...@@ -45,7 +45,7 @@ pub fn listen_on_ws2p_v2_endpoint(
listen(ws_url, move |ws| { listen(ws_url, move |ws| {
println!("DEBUG: Listen on host:port..."); println!("DEBUG: Listen on host:port...");
DeflateBuilder::new().build( DeflateBuilder::new().build(
Ws2pConnectionHandler::new( Ws2pConnectionHandler::try_new(
WsSender(ws), WsSender(ws),
service_sender.clone(), service_sender.clone(),
currency.clone(), currency.clone(),
......
...@@ -52,7 +52,7 @@ pub fn connect_to_ws2p_v2_endpoint( ...@@ -52,7 +52,7 @@ pub fn connect_to_ws2p_v2_endpoint(
// Connect to websocket // Connect to websocket
connect(ws_url, move |ws| { connect(ws_url, move |ws| {
DeflateBuilder::new().build( DeflateBuilder::new().build(
Ws2pConnectionHandler::new( Ws2pConnectionHandler::try_new(
WsSender(ws), WsSender(ws),
service_sender.clone(), service_sender.clone(),
currency.clone(), currency.clone(),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment