From 5111a3d5749625c3d8e26a24a5a32c4da58f18d3 Mon Sep 17 00:00:00 2001 From: hozan23 Date: Thu, 30 Nov 2023 23:51:18 +0300 Subject: net: Use ToConn and ToListener traits for objects that can be converted to Conn and Listener. --- jsonrpc/examples/client.rs | 2 +- jsonrpc/examples/server.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'jsonrpc/examples') diff --git a/jsonrpc/examples/client.rs b/jsonrpc/examples/client.rs index 8f46a8e..b28760d 100644 --- a/jsonrpc/examples/client.rs +++ b/jsonrpc/examples/client.rs @@ -17,7 +17,7 @@ fn main() { smol::future::block_on(async { let conn = TcpStream::connect("127.0.0.1:60000").await.unwrap(); let config = ClientConfig::default(); - let client = Client::new(conn.into(), config); + let client = Client::new(conn, config); let params = Req { x: 10, y: 7 }; let result: u32 = client.call("Calc.add", params).await.unwrap(); diff --git a/jsonrpc/examples/server.rs b/jsonrpc/examples/server.rs index 4109e0d..b09232f 100644 --- a/jsonrpc/examples/server.rs +++ b/jsonrpc/examples/server.rs @@ -46,7 +46,7 @@ fn main() { // Creates a new server let listener = TcpListener::bind("127.0.0.1:60000").await.unwrap(); let config = ServerConfig::default(); - let server = Server::new(listener.into(), config, ex); + let server = Server::new(listener, config, ex); // Register the Calc service register_service!(Calc, ping, add, sub, version); -- cgit v1.2.3