diff --git a/Cargo.toml b/Cargo.toml index 8186646..04e15c6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,12 +28,14 @@ required-features = ["model", "clap"] [dependencies] backtrace = "0.3.69" -byteorder = "1.5.0" # feature asn1rs-* asn1rs-model = { version = "0.4.0", path = "asn1rs-model", optional = true } asn1rs-macros = { version = "0.4.0", path = "asn1rs-macros", optional = true } +# feature protobuf +byteorder = { version = "1.5.0", optional = true } + # for binary only clap = { version = "4.4.18", features = ["derive", "env"], optional = true } @@ -45,7 +47,7 @@ codegen = "0.2.0" [features] default = ["macros", "model", "clap"] -protobuf = ["asn1rs-model/protobuf"] +protobuf = ["asn1rs-model/protobuf", "byteorder"] macros = ["asn1rs-macros"] model = ["asn1rs-model"] debug-proc-macro = ["asn1rs-macros/debug-proc-macro", "asn1rs-model/debug-proc-macro"] diff --git a/src/prelude.rs b/src/prelude.rs index f422c71..b0d2658 100644 --- a/src/prelude.rs +++ b/src/prelude.rs @@ -1,6 +1,7 @@ pub use crate::descriptor::prelude::*; #[cfg(feature = "macros")] pub use crate::macros::*; +#[cfg(feature = "protobuf")] pub use crate::protocol::protobuf::ProtobufEq; pub use crate::protocol::*; pub use crate::rw::*; diff --git a/src/protocol/mod.rs b/src/protocol/mod.rs index d70448c..b46e089 100644 --- a/src/protocol/mod.rs +++ b/src/protocol/mod.rs @@ -7,4 +7,5 @@ //! ``` pub mod per; +#[cfg(feature = "protobuf")] pub mod protobuf; diff --git a/src/rw/mod.rs b/src/rw/mod.rs index fdc9fe7..cb23d30 100644 --- a/src/rw/mod.rs +++ b/src/rw/mod.rs @@ -1,9 +1,13 @@ mod println; +#[cfg(feature = "protobuf")] mod proto_read; +#[cfg(feature = "protobuf")] mod proto_write; mod uper; pub use println::*; +#[cfg(feature = "protobuf")] pub use proto_read::*; +#[cfg(feature = "protobuf")] pub use proto_write::*; pub use uper::*;