Skip to content

More tiny crates? #3817

@tcharding

Description

@tcharding

We have a few problems right now that look like the solution is more tiny crates. This issue is to discuss if we want to do that. An alternative is to duplicate code and make things private.

  1. InputString and writer_err!: See also units: Remove internals::InputString from the public API  #3708 and Consider moving no-std/alloc error stuff from internals to a new stable crate #3322
  2. ParseIntError: Uses InputString
  3. Hex prefix string parsing functions and error types: Uses ParseIntError

These three things are all slightly unrelated and also exist for slightly different reasons. All three are used in multiple crates and are needed in order to stabalize.

  • (1) exists solely to assist with error handling in a no-std environment
  • (2) exists to add more context to integer parsing (includes multi-radix support)
  • (3) exits to enable parsing integers from hex strings (only relates to hex)

Where should they live

Currently

  • (1) is in internals
  • (2) and (3) are in units

Possible solutions:

  • Make everything private and duplicate everywhere
  • Make 3 tiny crates
  • Some mix of the two above
  • Leave as is and muddy up the dependencies (make hex depend on bitcoin-units)
  • ?

Other info

parse_int is already taken and does not do the same thing as (2)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions