Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Then what does this mean?

let x: u8 = E::Rest(0).into();

let y: E = x.into();



Bad example, that should panic (in a perfect world it should be a compile error). The invariant of the type is that `E::Rest` cannot hold zero.


Why is that a bad example? It's proof that implementing From does not solve the problem.




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

Search: