4 ms·
Of course it looks like C, it's using a C interface to interface with Ruby. Normal Rust does not look like that. Your comment is quite frankly entirely pointles
by rapsey 9y ago
Of course it looks like C, it's using a C interface to interface with Ruby. Normal Rust does not look like that. Your comment is quite frankly entirely pointless.
- whyever 9y agoYour 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.)
- deleted 9y ago[deleted]