traits
traits copied to clipboard
Use the API as intended by the subtle crate authors
This is admittedly a very nit-picky change, but according to the Subtle documentation (https://docs.rs/subtle/latest/subtle/struct.Choice.html#note), a Choice
should be converted to a bool
using the From
implementation. Specifically they added the following note to the unwrap_u8
documentation:
This function only exists as an escape hatch for the rare case where it’s not possible to use one of the subtle-provided trait impls. To convert a Choice to a bool, use the From implementation instead.
That functionality didn’t exist at the time this was written. We’ve slowly been migrating.
All that said, that isn’t the correct way to turbofish Into
, and I think in such cases the compiler can infer the proper type.
Fixed in #1088