Hacker News new | past | comments | ask | show | jobs | submit login

> Actually the problem is Rust currently doesn't implement traits for static-sized arrays because the size is part of the type signature and each size would need to be implemented separately.

But it does implement those traits for slices. So this isn't typically a problem in practice because you can coerce fixed-length arrays to slices and then compare those.




Indeed, though it's still a pain for nested arrays, as you have to coerce the inner layers first via mapping. Quite burdensome for arbitrary nesting.

Anyways, most of the time you're better off implementing a concrete type like he did.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: