near / borsh-rs

Rust implementation of Binary Object Representation Serializer for Hashing
https://borsh.io/
Apache License 2.0
306 stars 67 forks source link

feat: add `derive_use_cargo` default feature #272

Closed dj8yfo closed 9 months ago

dj8yfo commented 9 months ago

resolves #271

a way to disable proc-macro-crate (it depends on cargo binary being available) without annotating each derive with tautological #[borsh(crate = "borsh")]

sample1, derive_use_cargo : default features sample1 : proc-macro-crate dependency in Cargo.lock

sample2, derive_no_use_cargo : opt-out of derive_use_cargo feature sample2 : proc-macro-crate dependency absent in Cargo.lock


NOTE: this change causes breakage for no_std projects with borsh dependency renamed - sample3, derive_no_std_rename_breakage This commit breaks compilation on version update, and this fixes it.

frol commented 9 months ago

I am closing this PR as per https://github.com/near/borsh-rs/issues/271#issuecomment-1854690257