Sha256: c9d7f5c46a273ca2923c29dbc0137dc394591f86416cb32ceea94fdd99c6c3c1

Contents?: true

Size: 312 Bytes

Versions: 8

Compression:

Stored size: 312 Bytes

Contents

#[no_mangle]
pub extern fn is_absolute(string: *const c_char) -> bool {
  let c_str = unsafe {
    assert!(!string.is_null());

    CStr::from_ptr(string)
  };

  let r_str = str::from_utf8(c_str.to_bytes()).unwrap_or("");

  r_str.chars().next().unwrap_or("muffins".chars().next().unwrap()) == MAIN_SEPARATOR
}

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
faster_path-0.1.5 src/is_absolute.rs
faster_path-0.1.4 src/is_absolute.rs
faster_path-0.1.3 src/is_absolute.rs
faster_path-0.1.2 src/is_absolute.rs
faster_path-0.1.1 src/is_absolute.rs
faster_path-0.1.0 src/is_absolute.rs
faster_path-0.0.9 src/is_absolute.rs
faster_path-0.0.8 src/is_absolute.rs