diff options
author | hozan23 <hozan23@proton.me> | 2023-11-30 23:51:18 +0300 |
---|---|---|
committer | hozan23 <hozan23@proton.me> | 2023-11-30 23:51:18 +0300 |
commit | 5111a3d5749625c3d8e26a24a5a32c4da58f18d3 (patch) | |
tree | 0d8376af78d0ec09f3464ba4370ebb8cdd43826d /jsonrpc/examples | |
parent | d8425015363cc0ac4742f938dc3f8e9d0beaa933 (diff) |
net: Use ToConn and ToListener traits for objects that can be converted
to Conn and Listener.
Diffstat (limited to 'jsonrpc/examples')
-rw-r--r-- | jsonrpc/examples/client.rs | 2 | ||||
-rw-r--r-- | jsonrpc/examples/server.rs | 2 |
2 files changed, 2 insertions, 2 deletions
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); |