colin-kiegel / rust-derive-builder

derive builder implementation for rust structs
https://colin-kiegel.github.io/rust-derive-builder/
Apache License 2.0
1.28k stars 82 forks source link

Add #[builder(crate = "...")] for re-export scenarios #275

Closed TedDriggs closed 1 year ago

TedDriggs commented 1 year ago

This branch adds a new struct-level field which overrides the default crate path. This enables crates to re-export derive_builder::Builder and avoid any direct dependency on derive_builder in their downstreams.

Fixes #274

TedDriggs commented 1 year ago

The compiletest error here is legitimate; we seem to have lost a span on the custom error in this change, and I'm not sure where yet. That needs to be addressed before this can be merged.

TedDriggs commented 1 year ago

@ryo33 can you test this out using a git dependency and let me know how it goes?

ryo33 commented 1 year ago

@TedDriggs All worked well. Thank you!