You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `num_enum` dependency brings with it a large number of transitive
dependencies. Some of those transitive deps now have an aggressive MSRV
of 1.64+.
The existing usage of `num_enum` is very minimal: just one derived trait
for the `rustls_result` enum to provide it with a `From` impl for u32
primitive values.
This commit replaces the `num_enum` crate with a small
`u32_enum_builder!` macro rule loosely based on the Rustls
`enum_builder` macro. Since our use case is narrower, I've simplified
the macro and tailored it to the rustls-ffi use-case.
With the new implementation we can also drop the use of `try_from`. In
each case where we're converting from code -> result we're happy for the
default `from` impl's `InvalidParameter` variant to be used when given
an unknown code, making the use of `try_from` unnecessary.
This approach adds one complication related to `cbindgen`: it now has to
be instructed to expand the `rustls-ffi` crate before generating
bindings in order to find the `rustls_result` enum. Doing this requires
tweaking the `cbindgen.toml` to add a `parse.expand` configuration
setting. Notably this also means `cbindgen` now has to be run with a
nightly `rustc`. Since this is a developer only workflow it shouldn't be
too onerous a requirement.
We're now happily building with Rust 1.60 again and can also breathe
easy knowing we have a slimmer dependency profile!
tidy: replace rustls_result::try_from -> from.
0 commit comments