Odilf / barbarosa

A rubik's cube library
GNU General Public License v3.0
1 stars 0 forks source link

`Alg<Cube>` #14

Closed Odilf closed 1 year ago

Odilf commented 1 year ago

Alg<Cube> should be the same as Alg<Cube::Move>. This would basically replace the current Cube::Alg. I don't think it's possible to do that in rust but hey might as well try.

Actually it would be possible I think, just kind of cumbersome. Instead of having Alg<M: Move> you would need Alg<M: IntoMove> or something and IntoMove has one associated type which is Move and is implemented for every move and every cube. idk

Odilf commented 1 year ago

This was actually a great idea because otherwise you have to normalize the trait for concrete types (e.g.: <Cube4 as Cube>::Alg). Now you just do Alg<Cube4> 🥳