paritytech / paritytech/parity-common
[uint] Better constant support
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 311
- Forks
- 245
- PR merge metrics
- No merged PRs in 30d
Description
Most ways to construct values seem not to be usable in constants except for zero() and MAX. I wonder if it would be possible/desirable to have some way to construct these things in a const context, e.g. with from_big_endian()? Or by directly providing [u64; N_WORDS]?
Maybe then this could be made more convenient with macros, e.g. a macro that converts an integer literal to [u64; N_WORDS], usable in a const context.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no files or tests; start by locating the uint value constructors and the existing const-capable zero() and MAX implementations. Compare const-context options such as from_big_endian(), direct [u64; N_WORDS] construction, and an integer-literal macro. Done means a clearly agreed construction approach with const-context behavior and validation examples.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100