Stranger6667 / jsonschema-rs

JSON Schema validation library
https://docs.rs/jsonschema
MIT License
511 stars 91 forks source link

Cannot obtain `String` from `ErrorDescription` #488

Closed matteopolak closed 2 months ago

matteopolak commented 4 months ago

Hey there! I'm looking to obtain ownership over the String contained within ErrorDescription, but the only way I can see that being possible is cloning the string (via its Display impl), which isn't great since I already have ownership of the ErrorDescription.

Is there another way to do it that I'm missing? I was hoping for e.g. ErrorDescription::into_inner, or for the field to be pub

I can PR this if it sounds like something you'd consider adding to the library.

Stranger6667 commented 2 months ago

Hi! Yes, into_inner sounds good to me!

matteopolak commented 2 months ago

Great! Created #492 to resolve this.