pixels icon indicating copy to clipboard operation
pixels copied to clipboard

issue with minimal-winit example (but really all examples) get_frame_mut is not a defined method

Open Atovange opened this issue 2 years ago • 4 comments

on line 48 you have: world.draw(pixels.get_frame_mut()); but this method is not defined on the struct Pixels (I only see get_frame on the documentation)

I see the changes on all examples were made by @squ1dd13 two months ago

I'm sorry if I'm missing something and I don't get it

Atovange avatar Oct 16 '22 18:10 Atovange

get_frame_mut is defined in the current source (see here), but it wasn't defined in the version that the docs were built from. The documentation on docs.rs is for the last release (0.9.0), which doesn't include the most recent source changes - most notably the change from get_frame to get_frame_mut.

If you want to see the examples as they were when 0.9.0 was released, view the repository as it was at that point.

Sorry about the confusion. Hopefully that clears things up.

squ1dd13 avatar Oct 16 '22 19:10 squ1dd13

Ok I get it thanks for the clarification. But shouldn't the examples linked on the crates.io page give you code coherent with the latest release?

Atovange avatar Oct 16 '22 20:10 Atovange

That's a very good point. @parasyte Any ideas on how this could be fixed? It's not great for the crates.io page to be directing people to example code that will only work if they pull in the crate through git.

I didn't really consider this when I made my earlier pull request. Oops.

squ1dd13 avatar Oct 16 '22 20:10 squ1dd13

It’s a good question! The readme simply uses relative links, which just goes to the examples on the head of the main branch. I don’t know of an easy way to link to the tags without maintaining the links by hand for each release. If anyone has any ideas, I’m open to making the improvement!

See also https://github.com/parasyte/pixels/issues/311#issuecomment-1268973962 where this was mentioned recently with slightly different (but still confusing) results with the examples.

parasyte avatar Oct 17 '22 02:10 parasyte