Skip to content

Commit

Permalink
remove PartialEq bound from top-level Error type
Browse files Browse the repository at this point in the history
This might annoy some people, but it will be necessary in order to hold
generic pubkey error types inside of our error returns.

Our alternatives are:

* Implement some manual hacky notion of equality for pubkey error
  (either "never equal" or "equal based on comparing output of
  fmt::Display or something)
* Add a PartialEq bound on all the <Pk as FromStr>::Err types, which
  would make it impossible to use anything that e.g. contained an io
  error.

I don't think ether of these are good, and given that io::Error has "set
the standard" for error types to have basically no useful trait bounds
other than Debug and Display, we are okay to do this.
  • Loading branch information
apoelstra committed Sep 3, 2024
1 parent 3649850 commit 57bbde8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ pub trait ForEachKey<Pk: MiniscriptKey> {

/// Miniscript
#[derive(Debug, PartialEq)]
#[derive(Debug)]
pub enum Error {
/// Opcode appeared which is not part of the script subset
InvalidOpcode(Opcode),
Expand Down

0 comments on commit 57bbde8

Please sign in to comment.