4 ms·
Your comment is misleading. The code in question is inside a function of the signature extract_last_path_segment(&str, &str) This is pure Rust, no C inter
by whyever 9y ago
Your comment is misleading. The code in question is inside a function of the signature
extract_last_path_segment(&str, &str)
This is pure Rust, no C interface involved.
- sambe 9y agoPer my comment above linking the real implementation: the comment is perhaps misleading about the cause but its claim is largely true. Rust code tends not to look like this.
- whyever 9y agoWell, unsafe Rust does tend to look like this. You were claiming that it is only for interfacing with C code, but unsafe is also used for performance, as in the snippet above. You were IMHO incorrectly dismissing the parent comment based on that. (On the other hand, the code in question could probably rewritten in safe Rust while still avoiding the bound checks. It would be less straight forward though.)