(ptr: *const i8)
| 543 | } |
| 544 | |
| 545 | fn c_string(ptr: *const i8) -> Option<String> { |
| 546 | if ptr.is_null() { |
| 547 | return None; |
| 548 | } |
| 549 | let value = unsafe { std::ffi::CStr::from_ptr(ptr) } |
| 550 | .to_string_lossy() |
| 551 | .trim() |
| 552 | .to_owned(); |
| 553 | if value.is_empty() { |
| 554 | None |
| 555 | } else { |
| 556 | Some(value) |
| 557 | } |
| 558 | } |
| 559 | |
| 560 | fn now_ms() -> u64 { |
| 561 | SystemTime::now() |