Sha256: 4ef7444b8550838ce30adbfba078976638aae7b8bcd762b8810cf51435a03362

Contents?: true

Size: 295 Bytes

Versions: 5

Compression:

Stored size: 295 Bytes

Contents

use libc::c_char;
use std::ffi::{CStr};
use std::str;

#[no_mangle]
pub extern fn is_blank(string: *const c_char) -> bool {
  let c_str = unsafe {
    if string.is_null() {
      return true;
    }
    CStr::from_ptr(string)
  };

  str::from_utf8(c_str.to_bytes()).unwrap().trim().is_empty()
}

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
faster_path-0.1.13 src/is_blank.rs
faster_path-0.1.12 src/is_blank.rs
faster_path-0.1.11 src/is_blank.rs
faster_path-0.1.10 src/is_blank.rs
faster_path-0.1.8 src/is_blank.rs