mirror of
https://github.com/chirpstack/chirpstack.git
synced 2025-06-12 20:48:09 +00:00
Improve Rust SDK build flags / reduce dependencies.
This reduces the amount of dependencies in case not all features are being used. E.g. tonic is only needed if using gRPC and pbjson, pbjson-types and serde are only needed if using the JSON serialization.
This commit is contained in:
3
api/rust/src/common.rs
vendored
3
api/rust/src/common.rs
vendored
@ -2,7 +2,8 @@ use std::error::Error;
|
||||
use std::fmt;
|
||||
use std::str::FromStr;
|
||||
|
||||
tonic::include_proto!("common/common");
|
||||
include!(concat!(env!("OUT_DIR"), "/common/common.rs"));
|
||||
#[cfg(feature = "json")]
|
||||
include!(concat!(env!("OUT_DIR"), "/common/common.serde.rs"));
|
||||
|
||||
#[allow(clippy::from_over_into)]
|
||||
|
3
api/rust/src/gw.rs
vendored
3
api/rust/src/gw.rs
vendored
@ -2,7 +2,8 @@ use rand::Rng;
|
||||
use std::error::Error;
|
||||
use std::str::FromStr;
|
||||
|
||||
tonic::include_proto!("gw/gw");
|
||||
include!(concat!(env!("OUT_DIR"), "/gw/gw.rs"));
|
||||
#[cfg(feature = "json")]
|
||||
include!(concat!(env!("OUT_DIR"), "/gw/gw.serde.rs"));
|
||||
|
||||
#[allow(clippy::from_over_into)]
|
||||
|
3
api/rust/src/integration.rs
vendored
3
api/rust/src/integration.rs
vendored
@ -1,4 +1,5 @@
|
||||
tonic::include_proto!("integration/integration");
|
||||
include!(concat!(env!("OUT_DIR"), "/integration/integration.rs"));
|
||||
#[cfg(feature = "json")]
|
||||
include!(concat!(
|
||||
env!("OUT_DIR"),
|
||||
"/integration/integration.serde.rs"
|
||||
|
3
api/rust/src/internal.rs
vendored
3
api/rust/src/internal.rs
vendored
@ -1,2 +1,3 @@
|
||||
tonic::include_proto!("internal/internal");
|
||||
include!(concat!(env!("OUT_DIR"), "/internal/internal.rs"));
|
||||
#[cfg(feature = "json")]
|
||||
include!(concat!(env!("OUT_DIR"), "/internal/internal.serde.rs"));
|
||||
|
3
api/rust/src/meta.rs
vendored
3
api/rust/src/meta.rs
vendored
@ -1,2 +1,3 @@
|
||||
tonic::include_proto!("meta/meta");
|
||||
include!(concat!(env!("OUT_DIR"), "/meta/meta.rs"));
|
||||
#[cfg(feature = "json")]
|
||||
include!(concat!(env!("OUT_DIR"), "/meta/meta.serde.rs"));
|
||||
|
Reference in New Issue
Block a user