Skip to content

Commit

Permalink
feat: add derive feature (#992)
Browse files Browse the repository at this point in the history
  • Loading branch information
tottoto committed Mar 15, 2024
1 parent e3d708c commit 2a4aeaf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ exclude = [
bench = false

[features]
default = ["prost-derive", "std"]
prost-derive = ["dep:prost-derive"]
default = ["derive", "std"]
derive = ["dep:prost-derive"]
prost-derive = ["derive"] # deprecated, please use derive feature instead
no-recursion-limit = []
std = []

Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ where
// Based on serde's equivalent re-export [1], but enabled by default.
//
// [1]: https://github.com/serde-rs/serde/blob/v1.0.89/serde/src/lib.rs#L245-L256
#[cfg(feature = "prost-derive")]
#[cfg(feature = "derive")]
#[allow(unused_imports)]
#[macro_use]
extern crate prost_derive;
#[cfg(feature = "prost-derive")]
#[cfg(feature = "derive")]
#[doc(hidden)]
pub use prost_derive::*;
2 changes: 1 addition & 1 deletion tests-no-std/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ path = "../tests/src/lib.rs"
anyhow = { version = "1.0.45", default-features = false }
bytes = { version = "1", default-features = false }
cfg-if = "1"
prost = { path = "..", default-features = false, features = ["prost-derive"] }
prost = { path = "..", default-features = false, features = ["derive"] }
prost-types = { path = "../prost-types", default-features = false }
protobuf = { path = "../protobuf" }

Expand Down

0 comments on commit 2a4aeaf

Please sign in to comment.