From 0f1ee3a36c2e0e27b0372833428bd85ee5de74b0 Mon Sep 17 00:00:00 2001 From: glyph Date: Fri, 5 Nov 2021 13:28:30 +0200 Subject: [PATCH] move jsonrpc test to dev deps for buttons --- peach-buttons/Cargo.toml | 4 +++- peach-buttons/src/lib.rs | 5 ++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/peach-buttons/Cargo.toml b/peach-buttons/Cargo.toml index 0025c9b4..576f88c8 100644 --- a/peach-buttons/Cargo.toml +++ b/peach-buttons/Cargo.toml @@ -35,6 +35,8 @@ gpio-cdev = "0.2" jsonrpc-core = "11" jsonrpc-ws-server = "11" jsonrpc-pubsub = "11" -jsonrpc-test = "11" log = "0.4" snafu = "0.4" + +[dev-dependencies] +jsonrpc-test = "11" diff --git a/peach-buttons/src/lib.rs b/peach-buttons/src/lib.rs index 605517da..9361e725 100644 --- a/peach-buttons/src/lib.rs +++ b/peach-buttons/src/lib.rs @@ -7,8 +7,6 @@ use crossbeam_channel::bounded; use jsonrpc_core::futures::Future; use jsonrpc_core::*; use jsonrpc_pubsub::{PubSubHandler, Session, Subscriber, SubscriptionId}; -#[allow(unused_imports)] -use jsonrpc_test as test; use jsonrpc_ws_server::{RequestContext, ServerBuilder}; use log::{debug, error, info, warn}; @@ -103,6 +101,7 @@ pub fn run() -> Result<(), BoxError> { #[cfg(test)] mod tests { use super::*; + use jsonrpc_test as test_rpc; #[test] fn rpc_success() { @@ -111,7 +110,7 @@ mod tests { io.add_method("rpc_success_response", |_| { Ok(Value::String("success".into())) }); - test::Rpc::from(io) + test_rpc::Rpc::from(io) }; assert_eq!(rpc.request("rpc_success_response", &()), r#""success""#);