Skip to content

Remove Ord impl for Value #267

@uncomputable

Description

@uncomputable

It makes no semantic sense to compare values of different types. Rather, PartialOrd could return None if self.ty != other.ty.

Yes -- I tried this, but we then lose Ord on Word (which maaybe makes sense, you can compare them numerically though you have to decide the relationship between 0u4 and 0u16 etc), and on Node and on Policy... so it's far-reaching.

I think the right approach would be to change Policy to implement Ord manually in alphabetical order (we do this in rust-miniscript now; it was a PITA to implement) and then we can drop Ord on the smaller types.

(see #266)

We have to see how much work it is, but making the API more semantically consistent seems worth some effort.

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