amazon-ion / ion-schema-rust

Rust implementation of Ion Schema
https://amazon-ion.github.io/ion-schema/sandbox
Apache License 2.0
12 stars 6 forks source link

IonSchemaError and Violation should #[derive(PartialEq)] #136

Closed dlurton closed 1 year ago

dlurton commented 1 year ago

I would like to use these types in an existing error enum that already #[derive(PartialEq)]s, but I cannot, because neither type does the same. For example:

#[derive(PartialEq)]
enum MyError {
   ...,
   IonScheamError(ion_schema::result::IonSchemaError), 
   // ^ Rust complains because IonSchemaError doesn't implement `PartialEq`.
   ValidationError(ion_schema::violation::Violation)
  // ^ same (if the `ion_schema::Violation` module were `pub`)
}

See also #135 about making ion_schema::Violation pub.

desaikd commented 1 year ago

Fixed with #139