Sha256: 48c7483539a25e04f165a8238f66170a7a5d7bd4e60546532d032d779501f4ae

Contents?: true

Size: 384 Bytes

Versions: 8

Compression:

Stored size: 384 Bytes

Contents

#[no_mangle]
pub extern fn both_are_blank(s1: *const c_char, s2: *const c_char) -> bool {
  let c_str1 = unsafe {
    assert!(!s1.is_null());
    CStr::from_ptr(s1)
  };
  let c_str2 = unsafe {
    assert!(!s2.is_null());
    CStr::from_ptr(s2)
  };

  str::from_utf8(c_str1.to_bytes()).unwrap().trim().is_empty() &&
    str::from_utf8(c_str2.to_bytes()).unwrap().trim().is_empty()
}

Version data entries

8 entries across 8 versions & 1 rubygems

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