src/lib.rs in faster_path-0.0.5 vs src/lib.rs in faster_path-0.0.6
- old
+ new
@@ -23,9 +23,22 @@
r_str.chars().next().unwrap_or("muffins".chars().next().unwrap()) == MAIN_SEPARATOR
}
#[no_mangle]
+pub extern fn is_relative(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
+}
+
+#[no_mangle]
pub extern fn is_blank(string: *const c_char) -> bool {
let c_str = unsafe {
assert!(!string.is_null());
CStr::from_ptr(string)