135: Debug-panic in clamp_min/max if min/max is NAN r=cuviper a=jturner314
This also improves the docs for `clamp`, `clamp_min`, and `clamp_max`.
Closes#134.
Co-authored-by: Jim Turner <git@turner.link>
132: Add comments explaining why transmutes are safe r=cuviper a=Shnatsel
Add comments explaining why transmutes are safe so that people auditing unsafe code don't have to spend time figuring it out by themselves.
Co-authored-by: Sergey "Shnatsel" Davidoff <sdavydov@google.com>
126: Fix num parsing for invalid multi-byte sign chars r=cuviper a=HeroicKatora
Ensure that splitting the potential sign character from the remainder
respects UTF8 boundaries. This lets invalid characters fail correctly
with an error, instead of panicking.
Closes: #125
Co-authored-by: Andreas Molzer <andreas.molzer@gmx.de>
Ensure that splitting the potential sign character from the remainder
respects UTF8 boundaries. This lets invalid characters fail correctly
with an error, instead of panicking.
108: int: document PrimInt trait r=cuviper a=dvdhrm
This documents the PrimInt trait, explains its intentions and features
as well as mentions its origins for future reference.
Closes#11.
Co-authored-by: David Rheinsberg <david.rheinsberg@gmail.com>
90: Fix CheckedShl/CheckedShr documentation r=cuviper a=samueltardieu
Fix#57 and more:
- CheckedShl was hinting that None was returned on overflow rather than
on too large a rhs.
- Ditto for CheckedShr.
- CheckedShr documentation erroneously indicated that a left shift was
going to be performed instead of a right shift.
Co-authored-by: Samuel Tardieu <sam@rfc1149.net>
Fix#57 and more:
- CheckedShl was hinting that None was returned on overflow rather than
on too large a rhs.
- Ditto for CheckedShr.
- CheckedShr documentation erroneously indicated that a left shift was
going to be performed instead of a right shift.
81: Add wrapping shifts r=cuviper a=edmccard
Add traits `WrappingShl` and `WrappingShr` corresponding to the
standard library `wrapping_shl` and `wrapping_shr` methods. Implement
the trait on all primitive integer types as well as on `Wrapping`.
Co-authored-by: Ed McCardell <edmccard@hotmail.com>