News for hackers. Stuff that matters.
Re:Why aren't there C conferences? (2018) by at_compile_time on Friday August 26, 2022 @01:37PM (#32610489)
>do I really need to implement the Into<T> trait and use x.into() to do a conversion? Isn't it better if I just write the function that I'm using explicitly?

Firstly, you would implement From rather than Into. Into is blanket-derived for From. So if B implements From<A>, then A also implements Into<B>.

And no, you don't have to do this. If the function is never going to be generic, there's no sense in writing it that way. Solve the problem at hand, you can always go back and add abstraction later.

I really like Rust. I hear people say that it's hard, but I don't think it's harder than the problems it solves.

Re:Why aren't there C conferences? (2018) by bspammer on Saturday August 27, 2022 @05:30AM (#32617294)
> if B implements From<A>, then A also implements Into<B>

I think I’m misunderstanding, because I don’t see how this is possible given that you could be losing information in the conversion. Is this only for isomorphic types?

Re:Why aren't there C conferences? (2018) by jstimpfle on Saturday August 27, 2022 @06:37AM (#32617602)
A => B is the same as B <= A. Notice the change in direction.
Re:Why aren't there C conferences? (2018) by bspammer on Saturday August 27, 2022 @12:23PM (#32620611)
Oh duh, thanks :)