ariadne icon indicating copy to clipboard operation
ariadne copied to clipboard

feat: Use RPITIT instead of Box<dyn ...>

Open mlgiraud opened this issue 1 year ago • 2 comments

Just a small PR to replace Box<dyn ...> with RPITIT, since it is now stable. I believe this is what your todo in the trait was for?

mlgiraud avatar Jul 15 '24 09:07 mlgiraud

Maybe it would also make sense to return a type that implements the Error trait, instead of something that just implements Debug?

mlgiraud avatar Jul 15 '24 09:07 mlgiraud

Another question maybe: Why does the fetch function have to take a mutable reference to self? Shouldn't this be an immutable function?

EDIT: This makes it practically impossible to have the parser borrow data from an input cache, and also pass the input cache to the write function for the error report, since this would require a mutable borrow of the input cache, when the input cache is already borrowed read only for the parsed data.

mlgiraud avatar Jul 15 '24 09:07 mlgiraud

@zesterer Any updates on this?

mlgiraud avatar Oct 31 '24 12:10 mlgiraud

Thanks for the PR. Sorry, it got lost in my notifications. I think this is a positive change, although I'm surprised it's been stable for so long already: I'm used to things like this being nightly-only for a while!

zesterer avatar Nov 01 '24 20:11 zesterer