Sha256: 0f353de86ab88f2ebaf32f90804fc322728ccf74d7ae5d5a5e33ef753d2b5549
Contents?: true
Size: 405 Bytes
Versions: 3
Compression:
Stored size: 405 Bytes
Contents
#[no_mangle] pub extern fn basename_for_chop(string: *const c_char) -> *const c_char { let c_str = unsafe { assert!(!string.is_null()); CStr::from_ptr(string) }; let r_str = str::from_utf8(c_str.to_bytes()).unwrap(); let part = Path::new(r_str).file_name().unwrap_or(OsStr::new("")).to_str(); let output = CString::new(format!("{}", part.unwrap())).unwrap(); output.into_raw() }
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
faster_path-0.1.3 | src/basename_for_chop.rs |
faster_path-0.1.2 | src/basename_for_chop.rs |
faster_path-0.1.1 | src/basename_for_chop.rs |