rust-bitcoin-unsafe-fast/internals/src
Martin Habovstiak 5dd0c9253d Remove a bunch of `try_into().expect()`
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.
2025-03-20 20:19:50 +01:00
..
error Update input_string.rs 2025-02-25 12:03:03 +02:00
array.rs Remove a bunch of `try_into().expect()` 2025-03-20 20:19:50 +01:00
array_vec.rs chore: fix some typos in comments 2025-02-28 17:55:31 +08:00
compact_size.rs Run the formatter 2024-10-10 10:39:53 +11:00
const_tools.rs Refactor Rust version checking 2024-08-19 15:21:01 +02:00
lib.rs Remove a bunch of `try_into().expect()` 2025-03-20 20:19:50 +01:00
macros.rs Remove usage of impl_from_infallible in crates 2025-01-04 23:46:12 -06:00
parse.rs clippy: change accidental doccomments into correct comments 2024-09-30 12:30:57 +00:00
script.rs Re-write (and re-name) read_uint_iter 2024-09-09 06:31:39 +10:00
serde.rs Make `hex` in `internals` optional 2025-03-04 12:33:04 +01:00
slice.rs Remove a bunch of `try_into().expect()` 2025-03-20 20:19:50 +01:00
wrap_debug.rs Abstract out "debug-print hex fields" using WrapDebug 2025-02-20 10:56:12 -03:00