3 ms·
becomes much more readable when you newline before each period. Though to be honest I am sure someone will pop up with a much easier and cleaner way to do this
by dijit 3y ago
becomes much more readable when you newline before each period.
Though to be honest I am sure someone will pop up with a much easier and cleaner way to do this.
- ykonstant 3y agoI'll be keeping an eye on this then, because the above code is ridiculous; if it's the best (code-wise or performance-wise) way to do it in Rust, I can see the complaints.
- dralley 3y agoIt 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.