4 ms·
The real Rust basename implementation is not so low-level: https://doc.rust-lang.org/src/std/path.rs.html#1801-1808 https://doc.rust-lang.org/src/std/path.rs.h
by sambe 9y ago
The real Rust basename implementation is not so low-level:
https://doc.rust-lang.org/src/std/path.rs.html#1801-1808 https://doc.rust-lang.org/src/std/path.rs.html#1801-1808
I don't see how Rust vs C makes no difference. Both languages have trade-offs and I'm pretty sure that Rust advocates would claim the increased safety of the Rust part as a big advantage, and it will certainly reduce those core dumps. Probably the reason there are so many of those advocates is because they don't have to write such error-prone low-level code. Expressive code is more fun, in my experience.