3 ms·
It wouldn't be that much simpler if it wanted to do the equivalent thing in C. This is code for "set a pin in a completely thread safe way", whereas a lot of t
by dralley 3y ago
It wouldn't be that much simpler if it wanted to do the equivalent thing in C. This is code for "set a pin in a completely thread safe way", whereas a lot of the comparisons are "set a pin".
Which, as others have already pointed out, brings us to the very topic of this post. Rust prevents novices from messing up partly by forcing them to acknowledge ways in which the code might break, and it does that via the type system.