From 25277634944e6605f781ea2ff9349a77fd95d2ed Mon Sep 17 00:00:00 2001 From: trivernis Date: Sun, 6 Feb 2022 12:38:07 +0100 Subject: [PATCH] Fix compile errors Signed-off-by: trivernis --- src/lib.rs | 16 ++++++++-------- tests/test_serialization.rs | 1 + 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 6c824af0..0b898607 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -6,19 +6,19 @@ //! use tokio::net::TcpListener; //! //! /// Callback ping function -//! async fn handle_ping(ctx: &Context, event: Event) -> IPCResult<()> { +//! async fn handle_ping(ctx: &Context, event: Event) -> IPCResult { //! println!("Received ping event."); //! ctx.emit("pong", ()).await?; //! -//! Ok(()) +//! Ok(Response::empty()) //! } //! //! pub struct MyNamespace; //! //! impl MyNamespace { -//! async fn ping(_ctx: &Context, _event: Event) -> IPCResult<()> { +//! async fn ping(_ctx: &Context, _event: Event) -> IPCResult { //! println!("My namespace received a ping"); -//! Ok(()) +//! Ok(Response::empty()) //! } //! } //! @@ -46,7 +46,7 @@ //! .on("something", callback!(ctx, event, async move { //! println!("I think the server did something"); //! ctx.emit_to("mainspace-server", "ok", ()).await?; -//! Ok(()) +//! Ok(Response::empty()) //! })) //! .build() //! .add_namespace(namespace!(MyNamespace)) @@ -63,7 +63,7 @@ //! use std::net::ToSocketAddrs; //! use typemap_rev::TypeMapKey; //! use bromine::IPCBuilder; -//! use bromine::callback; +//! use bromine::prelude::*; //! use tokio::net::TcpListener; //! //! struct MyKey; @@ -80,7 +80,7 @@ //! .on("ping", callback!(ctx, event, async move { //! println!("Received ping event."); //! ctx.emit("pong", ()).await?; -//! Ok(()) +//! Ok(Response::empty()) //! })) //! .namespace("mainspace-server") //! .on("do-something", callback!(ctx, event, async move { @@ -92,7 +92,7 @@ //! *my_key += 1; //! } //! ctx.emit_to("mainspace-client", "something", ()).await?; -//! Ok(()) +//! Ok(Response::empty()) //! })) //! .build() //! // store additional data diff --git a/tests/test_serialization.rs b/tests/test_serialization.rs index 7826eec3..ac53c485 100644 --- a/tests/test_serialization.rs +++ b/tests/test_serialization.rs @@ -2,6 +2,7 @@ use bromine::prelude::*; #[cfg(feature = "serialize")] use serde::{de::DeserializeOwned, Serialize}; +use std::fmt::Debug; #[cfg(feature = "serialize_rmp")] #[test]