Skip to content

Commit

Permalink
Make protobuf actually optional (see feature flags)
Browse files Browse the repository at this point in the history
  • Loading branch information
kellerkindt committed Jan 20, 2024
1 parent acc8f18 commit 3630ab5
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }

Expand All @@ -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"]
Expand Down
1 change: 1 addition & 0 deletions src/prelude.rs
Original file line number Diff line number Diff line change
@@ -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::*;
1 change: 1 addition & 0 deletions src/protocol/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
//! ```
pub mod per;
#[cfg(feature = "protobuf")]
pub mod protobuf;
4 changes: 4 additions & 0 deletions src/rw/mod.rs
Original file line number Diff line number Diff line change
@@ -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::*;

0 comments on commit 3630ab5

Please sign in to comment.