Sha256: c2f516312601b5e7fbd92acb9bab5a8a23c310359aa28b304daeb627a822bebc
Contents?: true
Size: 477 Bytes
Versions: 5
Compression:
Stored size: 477 Bytes
Contents
use libc::c_char; use std::ffi::{CStr}; use std::str; #[no_mangle] pub extern fn both_are_blank(s1: *const c_char, s2: *const c_char) -> bool { let c_str1 = unsafe { if s1.is_null() { return true; } CStr::from_ptr(s1) }; let c_str2 = unsafe { if s2.is_null() { return true; } 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
5 entries across 5 versions & 1 rubygems