From a34122247742fcfc0d216b9e0c80225af08e6338 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Drwi=C4=99ga?= Date: Wed, 9 Oct 2019 15:50:26 +0200 Subject: [PATCH 1/4] Add Send + Sync test. --- server-utils/src/reactor.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/server-utils/src/reactor.rs b/server-utils/src/reactor.rs index bd9d6b90c..6e9361e55 100644 --- a/server-utils/src/reactor.rs +++ b/server-utils/src/reactor.rs @@ -148,3 +148,15 @@ impl RpcEventLoop { }); } } + +#[cfg(test)] +mod tests { + use super::*; + + fn send_and_sync(_: T) {} + + #[test] + fn make_sure_rpc_event_loop_is_send_and_sync() { + send_and_sync(RpcEventLoop::spawn().unwrap()); + } +} From 72f2f5b9507637a2d78657182fe5f56999153285 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Drwi=C4=99ga?= Date: Thu, 10 Oct 2019 10:40:40 +0200 Subject: [PATCH 2/4] Add test to make sure the tpc server is Send+Sync too. --- tcp/src/server.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tcp/src/server.rs b/tcp/src/server.rs index 8b42ed322..a6ac59c03 100644 --- a/tcp/src/server.rs +++ b/tcp/src/server.rs @@ -208,3 +208,15 @@ impl Drop for Server { } } } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn server_is_send_and_sync() { + fn is_send_and_sync() {} + + is_send_and_sync::(); + } +} From 8ed4709edb52ee6dfc0c11145b0897f9dfd4a51e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Drwi=C4=99ga?= Date: Thu, 10 Oct 2019 10:41:13 +0200 Subject: [PATCH 3/4] Review suggestions. --- server-utils/src/reactor.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server-utils/src/reactor.rs b/server-utils/src/reactor.rs index 6e9361e55..d93708fbf 100644 --- a/server-utils/src/reactor.rs +++ b/server-utils/src/reactor.rs @@ -153,10 +153,10 @@ impl RpcEventLoop { mod tests { use super::*; - fn send_and_sync(_: T) {} - #[test] fn make_sure_rpc_event_loop_is_send_and_sync() { - send_and_sync(RpcEventLoop::spawn().unwrap()); + fn is_send_and_sync() {} + + is_send_and_sync::(); } } From 071a714b3b0ab13519f3f92b20ac806404de8c3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Drwi=C4=99ga?= Date: Thu, 10 Oct 2019 10:42:31 +0200 Subject: [PATCH 4/4] Make sure to use latest tokio version. --- server-utils/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server-utils/Cargo.toml b/server-utils/Cargo.toml index 7a6fb7b32..e07156ece 100644 --- a/server-utils/Cargo.toml +++ b/server-utils/Cargo.toml @@ -16,7 +16,7 @@ globset = "0.4" jsonrpc-core = { version = "14.0", path = "../core" } lazy_static = "1.1.0" log = "0.4" -tokio = { version = "0.1" } +tokio = { version = "0.1.15" } tokio-codec = { version = "0.1" } unicase = "2.0"