utf8proc 0.1.2

Rust bindings to the utf8proc library
Documentation
use std::ffi::CStr;

/// Return the version of the underlying utf8proc library.
///
/// The utf8proc documentation states this should be in the [semver] format.
///
/// [semver]: https://semver.org/
pub fn version() -> &'static str {
    // SAFETY: Returns a valid pointer to a null-terminated string
    unsafe {
        CStr::from_ptr(utf8proc_sys::utf8proc_version())
            .to_str()
            .expect("version not UTF-8 formatted")
    }
}

/// Return the Unicode version utf8proc was compiled with.
pub fn unicode_version() -> &'static str {
    // SAFETY: Returns a valid pointer to a null-terminated string
    unsafe {
        CStr::from_ptr(utf8proc_sys::utf8proc_unicode_version())
            .to_str()
            .expect("version not UTF-8 formatted")
    }
}