djc / instant-acme

Simple ACME client
Apache License 2.0
76 stars 17 forks source link

Annotate Api::Problem error with thiserror::transparent #18

Closed dvdsk closed 1 year ago

dvdsk commented 1 year ago

Error variant Api::Problem prints "API error: {problem}" however the Problem struct has display impl that starts by printing "API error". Together this results in "API error: API error" followed by the details.

This fixes that by annotating Api::Problem with thiserror's transparent attribute which forwards the display impl to the underlying types display impl.

djc commented 1 year ago

Nice, thanks!