Skip to content
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

Add more comprehensive crate level docs for bevy_ptr #12391

Merged
merged 11 commits into from Mar 12, 2024

Conversation

james7132
Copy link
Member

Objective

Fixes #12301. Provide more comprehensive crate level docs for bevy_ptr, explaining it's methodology and design.

Solution

Write out said docs.

@james7132 james7132 added C-Docs An addition or correction to our documentation A-Pointers Relating to Bevy pointer abstractions labels Mar 9, 2024
@james7132 james7132 marked this pull request as ready for review March 9, 2024 20:45
Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really awesome stuff: this is exactly the sort of writeup I was hoping for when I spun out that issue.

Copy link
Member

@BD103 BD103 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is some great documentation, but I have a few clarity and grammatical suggestions.

@@ -6,8 +6,104 @@
[![Docs](https://docs.rs/bevy_ptr/badge.svg)](https://docs.rs/bevy_ptr/latest/bevy_ptr/)
[![Discord](https://img.shields.io/discord/691052431525675048.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2)](https://discord.gg/bevy)

The `bevy_ptr` crate provides low-level abstractions for working with pointers in a more safe way than using rust's raw pointers.
Pointers in computer programming, according to Wikipedia, are "objects in many programming languages that stores a memory address".
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Pointers in computer programming, according to Wikipedia, are "objects in many programming languages that stores a memory address".
A pointer, according to Wikipedia, is an "object in many programming languages that stores a memory address".

This fixes the plurality grammatical error where "stores" should be singular.

I would recommend rewriting this phrase, though. I don't think quoting Wikipedia is necessary here, especially with the "in many programming languages" part. It's implied that this is programming related, so the phrase is redundant.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. Reworded this section.

crates/bevy_ptr/README.md Outdated Show resolved Hide resolved
crates/bevy_ptr/README.md Outdated Show resolved Hide resolved
with them safer.

`bevy_ptr` is a crate that attempts to bridge the gap between the full blown unsafety of `*mut ()` and the safe `&'a T`, allowing users
to build progressively to choose what invariants to uphold.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
to build progressively to choose what invariants to uphold.
to choose which invariants to uphold.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reworded this ti be a bit clear what I meant here.

crates/bevy_ptr/README.md Outdated Show resolved Hide resolved
crates/bevy_ptr/README.md Outdated Show resolved Hide resolved
crates/bevy_ptr/README.md Outdated Show resolved Hide resolved
crates/bevy_ptr/README.md Outdated Show resolved Hide resolved
crates/bevy_ptr/README.md Outdated Show resolved Hide resolved
crates/bevy_ptr/README.md Outdated Show resolved Hide resolved
james7132 and others added 3 commits March 9, 2024 23:02
Co-authored-by: BD103 <59022059+BD103@users.noreply.github.com>
@james7132 james7132 requested a review from BD103 March 11, 2024 00:46
Copy link
Member

@BD103 BD103 left a 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!

@james7132 james7132 added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Mar 12, 2024
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Mar 12, 2024
Merged via the queue into bevyengine:main with commit b1d1077 Mar 12, 2024
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Pointers Relating to Bevy pointer abstractions C-Docs An addition or correction to our documentation S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Explain the philosophy of bevy_ptr in crate docs
3 participants