rust-bitcoin / rust-bitcoin/rust-miniscript

Model `OrdF64` as `NonNan`

Open
#445 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
426
Forks
200
Avg merge
7d 17h
Merged PRs (30d)
8

Description

It'd be better to model OrdF64 as NonNan because it brings panic (or error) closer to the cause of the issue making debugging easier. Potential inspiration: https://docs.rs/ordered-float/3.0.0/ordered_float/struct.NotNan.html

The change should be simple: make the field private and constructor panics or returns Result.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the OrdF64 definition, its field access, and all constructors and call sites. Read the linked ordered-float NotNan documentation for the intended model. Done means the field is private and construction either panics or returns Result, with affected uses updated accordingly.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
blockchain
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.