So I did a nice project for symbolic maths in rust a while ago - https://github.com/Metadiff/symbolic_polynomials
However, getting back to it I’ve just added two features to the crate, but was wondering if anyone knows of any simple way of reducing the boilerplate code for implementing operators. For instance, I have a lot of places where the class implements an operator for both
&T. Also, I need to explicitly implement and the reverse operator traits for the primitive variables with the polynomial, e.g.
Add<Polynomial> for i64. Is there any general way of avoiding it or at least writing less boilerplate.
Also, any suggestions or comments on the code are most welcome.