rust-numext icon indicating copy to clipboard operation
rust-numext copied to clipboard

Refactor convert / cast functions

Open chaoticlonghair opened this issue 6 years ago • 0 comments

  • Use TryFrom / TryInto to convert structs

    Remove:

    • https://github.com/cryptape/rust-numext/blob/33990f62c7c1558d0e8aacb4bfc461e60d6e53dc/constructor/src/fixed_uint/core/internal/kernel.rs#L162-L165
    • https://github.com/cryptape/rust-numext/blob/33990f62c7c1558d0e8aacb4bfc461e60d6e53dc/constructor/src/fixed_hash/core/internal/kernel.rs#L141-L144
  • Use TryFrom / TryInto to convert between fixed uints and primitive unsigned integer types.

    For example, cast a H256 into u64. (At present, no function can do this directly.)

chaoticlonghair avatar May 14 '19 18:05 chaoticlonghair