From eed5fdb54cc261756c828d9c6bd1114e16ec6aa8 Mon Sep 17 00:00:00 2001 From: hozan23 Date: Sat, 22 Jun 2024 15:53:22 +0200 Subject: jsonrpc/client: close the subscription channel when calling unsubscribe --- jsonrpc/examples/pubsub_client.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'jsonrpc/examples/pubsub_client.rs') diff --git a/jsonrpc/examples/pubsub_client.rs b/jsonrpc/examples/pubsub_client.rs index bbfd9b4..823089d 100644 --- a/jsonrpc/examples/pubsub_client.rs +++ b/jsonrpc/examples/pubsub_client.rs @@ -16,7 +16,6 @@ async fn run_client() { .await .expect("Build a client"); - let clientc = client.clone(); smol::spawn(async move {}).detach(); let sub = client @@ -34,7 +33,7 @@ async fn run_client() { loop { Timer::after(Duration::from_millis(500)).await; - let _: Pong = clientc + let _: Pong = client .call("Calc.ping", ()) .await .expect("Send ping request"); -- cgit v1.2.3