Closed Enet4 closed 4 years ago
This looks good to me, thanks!
bors r+
One question worth reflecting on is whether this documentation be normalized somewhere at module level,
While it could go on the cast
module, these traits are also re-exported at the root, so I don't know how often folks would even see the module-level documentation.
and whether it should be replicated to all methods or simply stay at each trait.
I think that would be overkill. The trait-level docs are already on the same page as all the methods.
I would also be open to adding examples with doctests if deemed useful.
It's clear enough to me what is meant by precision loss and truncation, but if you'd like to follow up with some examples, that would be fine.
Resolves #175. Document the traits
ToPrimitive
,FromPrimitive
andNumCast
that value can be represented by the target type when they are within the range admitted by the target type, and so truncation or precision loss may happen.One question worth reflecting on is whether this documentation be normalized somewhere at module level, and whether it should be replicated to all methods or simply stay at each trait. I would also be open to adding examples with doctests if deemed useful.