Closed B-Reif closed 2 years ago
One downside to our current approach is that the blocks in the README aren't tested by cargo test
, so it's possible for them to be incorrect / out of date. I'm not sure what the best approach is to solving that.
One downside to our current approach is that the blocks in the README aren't tested by
cargo test
, so it's possible for them to be incorrect / out of date. I'm not sure what the best approach is to solving that.
That's true. Maybe we can do something like: https://github.com/rust-lang/cargo/issues/383#issuecomment-720873790 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 EntityCommands
from ProtoCommands
:
error[E0623]: lifetime mismatch
--> src\lib.rs:397:46
|
22 | fn insert_self(&self, proto_commands: &mut ProtoCommands, asset_server: &Res<AssetServer>) {
| ------------- this type is declared with multiple lifetimes...
23 | let handle: Handle<Image> = asset_server.load(self.texture_path.as_str());
24 | let entity_commands = proto_commands.raw_commands();
| ^^^^^^^^^^^^ ...but data with one lifetime flows into the other here
error: aborting due to previous error
For more information about this error, try `rustc --explain E0623`.
Couldn't compile the test.
I'm not sure how to resolve this. It seems like this error pops up whenever raw_commands
is invoked.
@MrGVSV Two of the doc tests for the README are failing whenever we try to get
EntityCommands
fromProtoCommands
:error[E0623]: lifetime mismatch --> src\lib.rs:397:46 | 22 | fn insert_self(&self, proto_commands: &mut ProtoCommands, asset_server: &Res<AssetServer>) { | ------------- this type is declared with multiple lifetimes... 23 | let handle: Handle<Image> = asset_server.load(self.texture_path.as_str()); 24 | let entity_commands = proto_commands.raw_commands(); | ^^^^^^^^^^^^ ...but data with one lifetime flows into the other here error: aborting due to previous error For more information about this error, try `rustc --explain E0623`. Couldn't compile the test.
I'm not sure how to resolve this. It seems like this error pops up whenever
raw_commands
is invoked.
Hm, I wonder if it's because of the lifetime on EntityCommands
here:
https://github.com/MrGVSV/bevy_proto/blob/22c84e321586ce743cc39c43e412177cef6cb099/src/data.rs#L341-L343
Does eliding the 'p
lifetime on the references resolve the issue?
If not, we could maybe try making 'p: 'a
? Not sure if that would fix it though...
Does eliding the
'p
lifetime on the references resolve the issue?
Yes, that did it!
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.