diff options
author | tomsmeding <tom.smeding@gmail.com> | 2019-02-10 11:37:21 +0100 |
---|---|---|
committer | tomsmeding <tom.smeding@gmail.com> | 2019-02-10 11:37:21 +0100 |
commit | cb7748a7b064e1782f9d41ea6dc6b9fb87bdb0d8 (patch) | |
tree | 6e12e5f26db03f4c430fdb65527c2bc0546e0596 /src/lib.rs | |
parent | 30cd11327ffabde2c7454c9c17a97768b46494ee (diff) |
Add all widgets
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -1,9 +1,9 @@ use std::char; -use std::ffi::{self, CStr}; use std::io; -use libc; mod bindings; +mod util; +pub mod widgets; // #[cfg(test)] // mod tests { @@ -184,9 +184,6 @@ pub fn get_line() -> Option<String> { if ptr.is_null() { None } else { - let bytes = unsafe { CStr::from_ptr(ptr).to_bytes() }; - let res = Some(String::from_utf8(bytes.to_vec()).unwrap()); - unsafe { libc::free(ptr as *mut ffi::c_void); } - res + unsafe { Some(util::string_from_utf8_charp(ptr)) } } } |