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.