diff --git a/example/Cargo.toml b/example/Cargo.toml index 47094e6b..ca9fceab 100644 --- a/example/Cargo.toml +++ b/example/Cargo.toml @@ -51,3 +51,7 @@ path = "./async-stream-client.rs" [build-dependencies] ttrpc-codegen = { path = "../ttrpc-codegen"} + +[patch.crates-io] +ttrpc-compiler = { path = "/home/tim/project/ttrpc-rust/compiler"} + diff --git a/example/protocols/mod.rs b/example/protocols/mod.rs index d3d3a275..9ed5a35a 100644 --- a/example/protocols/mod.rs +++ b/example/protocols/mod.rs @@ -5,5 +5,4 @@ #[cfg(unix)] pub mod asynchronous; #[cfg(unix)] -pub use asynchronous as r#async; pub mod sync; diff --git a/example/server.rs b/example/server.rs index c15bf337..54d33f21 100644 --- a/example/server.rs +++ b/example/server.rs @@ -81,14 +81,8 @@ impl agent_ttrpc::AgentService for AgentService { fn main() { simple_logging::log_to_stderr(LevelFilter::Trace); - - let h = Box::new(HealthService {}) as Box; - let h = Arc::new(h); - let hservice = health_ttrpc::create_health(h); - - let a = Box::new(AgentService {}) as Box; - let a = Arc::new(a); - let aservice = agent_ttrpc::create_agent_service(a); + let hservice = health_ttrpc::create_health(Arc::new(HealthService {})); + let aservice = agent_ttrpc::create_agent_service(Arc::new(AgentService {})); utils::remove_if_sock_exist(utils::SOCK_ADDR).unwrap(); let mut server = Server::new()