From d3a24731e68812b9d1f8e94b36ba89faf3926d91 Mon Sep 17 00:00:00 2001 From: Paul Butler Date: Sun, 5 May 2024 12:25:53 -0400 Subject: [PATCH] default impl --- Cargo.lock | 2 +- stateroom-server/Cargo.toml | 2 +- stateroom/Cargo.toml | 2 +- stateroom/src/lib.rs | 7 ++----- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3ea199e..5da1b74 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1751,7 +1751,7 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "stateroom" -version = "0.4.1" +version = "0.4.2" dependencies = [ "serde", ] diff --git a/stateroom-server/Cargo.toml b/stateroom-server/Cargo.toml index e00585f..7addee0 100644 --- a/stateroom-server/Cargo.toml +++ b/stateroom-server/Cargo.toml @@ -12,6 +12,6 @@ description = "Server for Stateroom services over WebSockets" axum = { version = "0.7.5", features = ["ws"] } dashmap = "5.5.3" futures-util = "0.3.30" -stateroom = {path="../stateroom", version="0.4.0"} +stateroom = {path="../stateroom", version="0.4.1"} tokio = { version = "1.37.0", features = ["rt-multi-thread"] } tracing = "0.1.40" diff --git a/stateroom/Cargo.toml b/stateroom/Cargo.toml index cfcb63c..570d0b2 100644 --- a/stateroom/Cargo.toml +++ b/stateroom/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "stateroom" -version = "0.4.1" +version = "0.4.2" authors = ["Paul Butler "] edition = "2018" readme = "../README.md" diff --git a/stateroom/src/lib.rs b/stateroom/src/lib.rs index ecfd051..1b32d2c 100644 --- a/stateroom/src/lib.rs +++ b/stateroom/src/lib.rs @@ -138,6 +138,7 @@ pub trait StateroomServiceFactory: Send + Sync + 'static { ) -> Result; } +#[derive(Default)] pub struct DefaultStateroomFactory { _marker: std::marker::PhantomData, } @@ -146,11 +147,7 @@ impl StateroomServiceFactory for DefaultStateroom type Service = T; type Error = Infallible; - fn build( - &self, - _: &str, - _: Arc, - ) -> Result { + fn build(&self, _: &str, _: Arc) -> Result { Ok(T::default()) } }