Previously we've used `try_into().expect()` because const generics were unavailable. Then they became available but we didn't realize we could already convert a bunch of code to not use panicking conversions. But we can (and could for a while). This adds an extension trait for arrays to provide basic non-panicking operations returning arrays, so they can be composed with other functions accepting arrays without any conversions. It also refactors a bunch of code to use the non-panicking constructs but it's certainly not all of it. That could be done later. This just aims at removing the ugliest offenders and demonstrate the usefulness of this approach. Aside from this, to avoid a bunch of duplicated work, this refactors BIP32 key parsing to use a common method where xpub and xpriv are encoded the same. Not doing this already led to a mistake where xpriv implemented some additional checks that were missing in xpub. Thus this change also indirectly fixes that bug. |
||
---|---|---|
.. | ||
contrib | ||
src | ||
CHANGELOG.md | ||
Cargo.toml | ||
README.md |
README.md
Rust Bitcoin - primitive types.
This crate provides primitive data types that are used throughout the
rust-bitcoin
ecosystem.
Semver compliance
Functions marked as unstable (e.g. foo__unstable
) are not guaranteed to uphold semver compliance.
They are primarily provided to support rust-bitcoin
.
Minimum Supported Rust Version (MSRV)
This library should always compile with any combination of features on Rust 1.63.0.
Licensing
The code in this project is licensed under the Creative Commons CC0 1.0 Universal license. We use the SPDX license list and SPDX IDs.