summaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 5a86bdf..15cd5ff 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -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)) }
}
}