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

> A more direct translation of the sqlite strategy here is to use get_unchecked instead of [], and then you get the same behaviors.

Array access was just an example. My point was that Rust makes 100% code coverage for unit tests well neigh impossible.

For those of us who like 100% test coverage, that is a major annoyance. For way I use Rust that could be fixed by the tooling simply not counting unreachable!() lines as unreached. For Sqlite, who does branch coverage testing on the compiled binary you would have to go a step further, and provide a compile time option that elides all paths that lead to unreachable!() from the binary. I recall Sqlite saying when they changed to 100% branch coverage, their bug reports dropped by a factor of 7. I hope I remember that correctly. If I do, I'm pretty sure they won't be looking at Rust until they can achieve the same outcome. They can't come close now.

Replacing every array access with get_unchecked() and the consequent explosion of unsafe area's wouldn't fly with anyone I worked with. You did say to me in another thread unsafe is perfectly fine in Rust programs, but you are literally the only person holding that opinion I come across.



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

Search: