alloy-rs / alloy-rs/core

[Feature] Unified type convert api of U256 and I256

Open
#900 4 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Rust
Stars
966
Forks
274
Avg merge
1d 21h
Merged PRs (30d)
15

Description

### Component

primitives

### Describe the feature you would like

Now we could use `U256::to::()` and `I256::as_u64()`, but not vice visa.

In addition
* There's no `I256::as_u128`/`I256::as_i128`
* We have to use `f64::from(U256)`, but not `U256::to::()`
* There's even no `f64::from(I128)`

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.