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/src/client.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'jsonrpc/src/client.rs') diff --git a/jsonrpc/src/client.rs b/jsonrpc/src/client.rs index 0061002..69c2e6d 100644 --- a/jsonrpc/src/client.rs +++ b/jsonrpc/src/client.rs @@ -2,7 +2,7 @@ use log::debug; use serde::{de::DeserializeOwned, Serialize}; use karyons_core::util::random_32; -use karyons_net::Conn; +use karyons_net::ToConn; use crate::{ codec::{Codec, CodecConfig}, @@ -23,12 +23,12 @@ pub struct Client { impl Client { /// Creates a new RPC client by passing a Tcp, Unix, or Tls connection. - pub fn new(conn: Conn, config: ClientConfig) -> Self { + pub fn new(conn: C, config: ClientConfig) -> Self { let codec_config = CodecConfig { max_allowed_buffer_size: 0, ..Default::default() }; - let codec = Codec::new(conn, codec_config); + let codec = Codec::new(conn.to_conn(), codec_config); Self { codec, config } } -- cgit v1.2.3