Note rotate_{left,right} in wrapping_sh{lr} docs#31535
Note rotate_{left,right} in wrapping_sh{lr} docs#31535bors merged 1 commit intorust-lang:masterfrom ketsuban:more-detail-in-wrapping-shift-documentation
Conversation
|
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @nikomatsakis (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
|
It might also be a good idea to also add or change the examples for these functions to ones that actually behave differently to rotate. |
|
Good point, since I was in the middle of writing “they already do” when I thought to check in the playground. That definitely contributes to the confusion. |
|
@bors: r+ rollup Thanks! Additional examples would be good too, but even just this is an improvement so far. |
|
📌 Commit 8d5dcf9 has been approved by |
…ift-documentation, r=steveklabnik `wrapping_shl` and `wrapping_shr` are easy to mistake for rotations, when in fact they work somewhat differently. The documentation currently available is a little sparse and easy to misinterpret, so I've added a warning to anyone who bumps into them that the equivalent rotate methods may actually be what they're looking for. If it's deemed useful to add a symmetrical mention to the documentation for the `rotate_left` and `rotate_right` methods, I can certainly have a go at that, but my gut feeling is that people likely to want a rotate will already know about the wrapping-arithmetic methods, for example from writing CPU simulators.
…ift-documentation, r=steveklabnik `wrapping_shl` and `wrapping_shr` are easy to mistake for rotations, when in fact they work somewhat differently. The documentation currently available is a little sparse and easy to misinterpret, so I've added a warning to anyone who bumps into them that the equivalent rotate methods may actually be what they're looking for. If it's deemed useful to add a symmetrical mention to the documentation for the `rotate_left` and `rotate_right` methods, I can certainly have a go at that, but my gut feeling is that people likely to want a rotate will already know about the wrapping-arithmetic methods, for example from writing CPU simulators.
wrapping_shlandwrapping_shrare easy to mistake for rotations, when in fact they work somewhat differently. The documentation currently available is a little sparse and easy to misinterpret, so I've added a warning to anyone who bumps into them that the equivalent rotate methods may actually be what they're looking for.If it's deemed useful to add a symmetrical mention to the documentation for the
rotate_leftandrotate_rightmethods, I can certainly have a go at that, but my gut feeling is that people likely to want a rotate will already know about the wrapping-arithmetic methods, for example from writing CPU simulators.