From 34ad2a86816ab25d76574fb24794b0bde85fd88f Mon Sep 17 00:00:00 2001 From: alemi Date: Mon, 19 Feb 2024 18:29:59 +0100 Subject: [PATCH] chore: removed tonic, using prost-build directly --- Cargo.toml | 3 +-- build.rs | 11 ++++------- src/tcp/mod.rs | 2 +- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index aff86e2..3634fa0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,12 +19,11 @@ prost = "0.12.3" serde = { version = "1.0.196", features = ["derive"] } tokio = { version = "1.36", features = ["net", "macros", "rt-multi-thread", "io-util"] } tokio-native-tls = "0.3.1" -tonic = "0.11.0" tracing = "0.1.40" tracing-subscriber = "0.3.18" [build-dependencies] -tonic-build = "0.11.0" +prost-build = "0.12" [features] default = [] diff --git a/build.rs b/build.rs index 2e32e21..ba352ed 100644 --- a/build.rs +++ b/build.rs @@ -1,9 +1,6 @@ fn main() -> Result<(), Box> { - tonic_build::configure() - .compile( - &["src/tcp/mumble.proto"], - &["src/tcp"], - ) - .unwrap(); - Ok(()) + Ok(prost_build::compile_protos( + &["src/tcp/mumble.proto"], + &["src/tcp"], + )?) } diff --git a/src/tcp/mod.rs b/src/tcp/mod.rs index e6e1e6a..618f653 100644 --- a/src/tcp/mod.rs +++ b/src/tcp/mod.rs @@ -3,7 +3,7 @@ pub mod control; pub mod proto { use prost::Message; - tonic::include_proto!("mumble"); + include!(concat!(env!("OUT_DIR"), "/mumble.rs")); #[derive(Debug)] pub enum Packet {