rust-bitcoin-unsafe-fast/internals/src
merge-script c59b9e3d1a
Merge rust-bitcoin/rust-bitcoin#2929: Introduce `ToU64` trait
579b76b7cb Introduce ToU64 conversion trait (Tobin C. Harding)

Pull request description:

  The idea for this was pulled out of Steven's work in #2133

  We already explicitly do not support 16 bit machines.

  Also, because Rust supports `u182`s one cannot infallibly convert from a `usize` to a `u64`. This is unergonomic and results in a ton of casts.

  We can instead limit our code to running only on machines where `usize` is less that or equal to 64 bits then the infallible conversion is possible.

  Since 128 bit machines are not a thing yet this does not in reality introduce any limitations on the library.

  Add a "private" trait to the `internals` crate to do infallible conversion to a `u64` from `usize`.

  Implement it for all unsigned integers smaller than `u64` as well so we have the option to use the trait instead of `u32::from(foo)`.

ACKs for top commit:
  Kixunil:
    ACK 579b76b7cb
  apoelstra:
    ACK 579b76b7cb successfully ran local tests

Tree-SHA512: 2eaddfff995987a346e052386c6dfef3510e4732e674e3a2cfab60ee391b4cce1bf7ba4fb2dfd4926f8203d7251eea2198ccb61f0b40332e624c88fda4fa7f48
2024-08-08 19:05:23 +00:00
..
error Link to std::error::Error 2024-06-14 14:00:58 +10:00
array_vec.rs Remove build cfg for versions less than MSRV 2024-08-08 12:03:06 +10:00
const_tools.rs Add tools that help with making code `const` 2023-12-15 01:37:33 +01:00
error.rs Removed //! spare line at end of headers 2024-05-22 12:23:57 +01:00
lib.rs Introduce ToU64 conversion trait 2024-08-08 15:32:40 +10:00
macros.rs Merge rust-bitcoin/rust-bitcoin#2585: Improve array macros 2024-05-28 16:25:59 +00:00
parse.rs Use full path in all macro usage of Result 2024-01-18 19:11:01 +01:00
serde.rs Move serde_round_trip macro to internals 2024-07-06 14:51:30 +10:00