-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
document public items, fix doc tests #14
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! This actually came at the perfect time because I'm doing some major rework to the project (transitioning to Bevy's Reflect
from the deprecated typetag
) and really needed to update the docs for the last patch release of this version. So thank you for this! 😄
Just a few suggestions/changes.
@@ -8,10 +15,11 @@ pub mod prototype; | |||
mod utils; | |||
|
|||
pub mod prelude { | |||
pub use bevy_proto_derive::*; | |||
//! Includes all public types and the macro to derive [`ProtoComponent`](super::components::ProtoComponent). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it worth suggesting that it's often best used as use bevy_proto::prelude::*
? Or is it better to just let the user decide how they want to use it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this might depend on how they're using it, and if they're using all of the bevy_proto
types in the same place. I'd just let users decide how to use it.
On a related note I was thinking we could reduce the number of public modules. Specifically, we could hide components
and plugin
and just pub use components::ProtoComponent
and pub use plugin::ProtoPlugin
since those mods don't contain anything else anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, let's do that.
One downside to our current approach is that the blocks in the README aren't tested by |
That's true. Maybe we can do something like: rust-lang/cargo#383 (comment) in lib.rs? |
Sure, I'll give it a go |
@MrGVSV Two of the doc tests for the README are failing whenever we try to get
I'm not sure how to resolve this. It seems like this error pops up whenever |
Hm, I wonder if it's because of the lifetime on Lines 341 to 343 in 22c84e3
Does eliding the 'p lifetime on the references resolve the issue?
If not, we could maybe try making |
Yes, that did it! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thank you for these changes!
This PR adds a lint to warn for missing docs, adds some documentation for public items that didn't have any, and fixes examples that were failing in
rustdoc
tests.