cmov: add correct usage examples for both `Cmov` and `CmovEq`
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 45/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- rust
- Domain
- documentation
Research direction
Start by reading the existing tests for Cmov and CmovEq, then compare their structure with other RustCrypto examples. Add clear, commented usage examples for both APIs and document the cautions around direct Cmov use, == conditions, branching, and the ^ operator; the examples should follow the repository's established format.
Written by the indexing model from the issue text.
Description
I plan to get these done later today also, and they'll follow the tests as a rough example (but obviously cleaner, easier to understand and commented so users know what's going on).
I plan to add warnings about using Cmov directly, as it would act more of an optimisation barrier if a condition is set to x == y.
I may also add warnings about branching in general, and using the ^ operator where the functions provided by CmovEq aren't adequate (which will be extremely unlikely but still probably worth noting). I'll also briefly explain why using == is bad, but I'm no branching expert so that may require some tweaking.
I'll try to adhere to the RustCrypto example format in order to reduce PR review time, and for consistency.
I think I'll try and get #920 fixed up first though.
- Dominant language
- Rust
- Stars
- 674
- Forks
- 170
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 10
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from RustCrypto/utils
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
RustCrypto/utils#1546 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
RustCrypto/utils#1537 · 7 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
RustCrypto/utils#1534 · 2 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 45/100
RustCrypto/utils#1529 · 4 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
RustCrypto/utils#1510 · 1 comment ·
All issues in RustCrypto/utils
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
BurntSushi/jiff#653 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
ZcashFoundation/zeeder#106 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
oxidize-rb/rb-sys#807 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
todo:ticket
Difficulty 2/5 1-2 days Newbie friendliness 74/100