Hello hope y'all doing well 👋
I have seen that ariadne::Report did not implement Error and Display and i thought it was a problem for some reasons:
- It doesn't allow it to act more as a Result, harder to maneuver
- It makes situations like error chaining harder due having to manually put into a string first then wrap it somehow
- Sometimes using Display and Debug on it can be useful
Also a detail about ariadne::Cache, i tried to make it Clone but i failed to address all the needs there with the dupe function, and maybe it could implement Clone directly instead?
Another thing is that for Display to work well it needs pre-acess to C: Cache, so i took the liberty to move it into ReportBuilder directly, which sequentially then goes to Report (I also included a assert to be sure it tells the developer that it is needed), but i guess y'all might want this different, just an idea
I have tried to make some changes to address this, take this PR as more of a request since i'm unsure if i did it too well, but i think there is very few things to address to make this PR ok
I also took the liberty to move write_to_string impl from the tests into Report directly, as it its useful there
Thank you for your time 🎈 🎈
Hello hope y'all doing well :wave:
I have seen that `ariadne::Report` did not implement `Error` and `Display` and i thought it was a problem for some reasons:
- It doesn't allow it to act more as a Result, harder to maneuver
- It makes situations like error chaining harder due having to manually put into a string first then wrap it somehow
- Sometimes using Display and Debug on it can be useful
Also a detail about `ariadne::Cache`, i tried to make it `Clone` but i failed to address all the needs there with the `dupe` function, and maybe it could implement `Clone` directly instead?
Another thing is that for `Display` to work well it needs pre-acess to `C: Cache`, so i took the liberty to move it into `ReportBuilder` directly, which sequentially then goes to `Report` (I also included a assert to be sure it tells the developer that it is needed), but i guess y'all might want this different, just an idea
I have tried to make some changes to address this, take this PR as more of a request since i'm unsure if i did it too well, but i think there is very few things to address to make this PR ok
I also took the liberty to move `write_to_string` impl from the tests into `Report` directly, as it its useful there
Thank you for your time :balloon: :balloon: