Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make common generics more terse #573

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Commits on Aug 8, 2023

  1. Rename traits MiniscriptKey and ScriptContext

    In an effort to make the code more terse with no loss of clarity rename
    the crate's main two traits `MiniscriptKey` to `Key` and `ScriptContext`
    to `Context`.
    
    The diff is big but can be verified by simply doing a search-and-replace
    on `MiniscriptKey` -> `Key` and `ScriptContext` -> `Context`. Then run
    `cargo +nightly fmt`. No other manual changes.
    tcharding committed Aug 8, 2023
    Configuration menu
    Copy the full SHA
    690a1aa View commit details
    Browse the repository at this point in the history
  2. Take advantage of shorter generic Key

    Now we have `Key` instead of `MiniscriptKey` we can take advantage of
    the shorter name to inline the where clauses when appropriate.
    tcharding committed Aug 8, 2023
    Configuration menu
    Copy the full SHA
    f8a847d View commit details
    Browse the repository at this point in the history
  3. Add MiniscriptKey and ScriptContext aliases

    We just renamed the `MinscriptKey` trait to `Key` and `ScriptContext` to
    `Context`.
    Add an alias for each of them to the original name. This helps backwards
    compatibility but also makes the library more ergonomic since the new
    names are so generic they could cause naming conflicts in downstream
    crates.
    tcharding committed Aug 8, 2023
    Configuration menu
    Copy the full SHA
    cf66078 View commit details
    Browse the repository at this point in the history
  4. Add ScriptContextError alias

    Add an alias to the `miniscript::context` module to maintain backwards
    comparability. Also, as for `ScriptContext` this may reduce potential
    naming conflicts downstream because "context" is not that unique.
    
    Note the alias is in `miniscript::context` but in `miniscript` there is
    a re-export of `Contetxt` but not one of the error.
    tcharding committed Aug 8, 2023
    Configuration menu
    Copy the full SHA
    24c11c0 View commit details
    Browse the repository at this point in the history