rust-bitcoin-unsafe-fast/internals/src
Martin Habovstiak a013700527 Replace uses of `chunks_exact` with `as_chunks`
In the past we've been using `chunks_exact` because const generics were
unstable but then, when they were stabilized we didn't use `as_chunks`
(or `array_chunks`) since they were unstable. But the instability was
only because Rust devs don't know how to handle `0` being passed in. The
function is perfectly implementable on stable. (With a tiny,
easy-to-understand `unsafe` block.) `core` doesn't want to make a
decision for all other crates yet but we can make it for our own crates
because we know that we simply never pass zero. (And even if we did, we
could just change the decision.)

It also turns out there's a hack to simulate `const {}` block in our
MSRV, so we can make compilation fail early.

This commit adds an extension trait to internals to provide the methods,
so we no longer have to use `chunks_exact`. It also cleans up the code
quite nicely.
2025-03-06 19:02:08 +01:00
..
error Update input_string.rs 2025-02-25 12:03:03 +02: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 Replace uses of `chunks_exact` with `as_chunks` 2025-03-06 19:02:08 +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 Replace uses of `chunks_exact` with `as_chunks` 2025-03-06 19:02:08 +01:00
wrap_debug.rs Abstract out "debug-print hex fields" using WrapDebug 2025-02-20 10:56:12 -03:00