rust-bitcoin-unsafe-fast/internals
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
..
contrib CI: Remove shebang from non-executable scripts 2024-05-31 10:10:00 +10:00
src Replace uses of `chunks_exact` with `as_chunks` 2025-03-06 19:02:08 +01:00
CHANGELOG.md Bump version of internals to 0.4.0 2024-09-18 12:22:59 +10:00
Cargo.toml Make `hex` in `internals` optional 2025-03-04 12:33:04 +01:00
README.md chore: format and standardize all markdowns files 2024-04-27 06:29:23 -03:00
build.rs 2024-08-25 automated rustfmt nightly 2024-08-25 01:14:09 +00:00

README.md

Rust Bitcoin Internals

This crate is only meant to be used internally by crates in the rust-bitcoin ecosystem.

This crate will never be stabilized, depend on it at your own risk.