-
Notifications
You must be signed in to change notification settings - Fork 70
Please re-export bson lib. #281
Comments
I think this makes a lot of sense; there's no reason to force users to manually keep the version they import directly in sync with the version this crate uses. @kyeah, are you okay with this change? If so, I'll make a PR doing it |
+1, SGTM. Thanks for bringing up this issue @thedodd. |
Awesome! 🙌 You guys rock! Thanks for the quick response. |
Upon further inspection, this might not be possible right now; while it's possible to reexport all of the items in the It's possible that there might be a clever solution to define a new macro that "wraps" the old one, but I'm not sure what it would look like. The issue of macros not being items complicates things here too; since there's no module path for them, we couldn't define our own macro called Given that the |
@saghm we may be able to with That link is entitled “proc-macro” but mentions macro_rules macros. Worth some experimentation. Another item I came by: https://stackoverflow.com/questions/50037091/how-to-use-macros-from-re-exported-crates |
Looks like Rust 1.30 (which was just released) adds the feature I mentioned, which obviates any need for a workaround: https://blog.rust-lang.org/2018/10/25/Rust-1.30.0.html |
On a related note: can you guys in the meantime release a 0.3.11 version of this crate? That would be the one that already depends on bson 0.13, which fixes a serialization bug (which I've been blocked on for some time now). |
It would be really awesome if this create would
pub use bson;
from the root of the library. Here is some reasoning as to why:bson
dependency changes, everything breaks. Users of this library must (currently) depend on the BSON crate (because you need to in order to use the mongo crate).minor
version ofbson
which matches this crate's dep. When the bson dep is updated from, say,0.10
->0.12
, this doesn't help.bson = "*"
does not help either, because if bson0.13
is released, and this create still requires0.12
, then things still break.This issue presents as follows:
Error message is spot on, and very helpful. But there is still a compilation error.
Once re-exported by this crate, users would bring it into scope via
use mongodb::bson;
and would not even need to declare it as an additional dependency.As always, thanks for the great work on this lib. I'm stoked to see it continue to evolve. Hoping to help out a bit more in the future myself. Especially to get some async i/o support in place.
The text was updated successfully, but these errors were encountered: