-
Notifications
You must be signed in to change notification settings - Fork 920
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
List limits for Limits::downlevel_defaults and downlevel_webgl2_defaults in docs. #3988
List limits for Limits::downlevel_defaults and downlevel_webgl2_defaults in docs. #3988
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.
Thanks for the improvements!
personally I'm not a huge fan of duplicating the constant values from the code into the docs (in particular those that aren't dicated by the spec), but I get that it's quite annoying when browsing e.g. docs.rs.
To make sure these stay in sync, if you change the list to a doctest, you can assert the documented list is the same as that returned by the function. |
What do you mean? How do I make a doctest without changing how the docs look in the end result? I would love to do that. |
The documentation will end up looking different - it would be in a code block, and we'd need something other than bold to determine which ones have changed. |
I'll try that. I'll add another commit and see what you think. |
Ok so I marked those changed from defaults to downlevel defaults are marked with a |
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.
nice! This is a much better solution!
Checklist
cargo clippy
.cargo clippy --target wasm32-unknown-unknown
if applicable.Description
When looking at the docs for Limits, the actual limits returned by the above default functions are not listed. This PR, among a few other small changes to make things more clear, lists the values for the Limits returned by each of those functions within the docs. This PR makes the following changes:
Limits::downlevel_defaults
andLimits::downlevel_webgl2_defaults
in the documentation forLimits
.Limits
to be their binary unit counterparts to avoid confusion (MiB instead of MB as a true megabyte is 1000 KB instead of 1024 even though it is often used to mean the latter, as is done in the docs as they stand).max_buffer_size
used for both<Limits as Default>::default
anddownlevel_defaults
from1 << 28
to256 << 20
for clarity and readability. This follows the pattern of bothmax_uniform_buffer_binding_size
andmax_storage_buffer_binding_size
which use a similar notation.