diff --git a/rust/Cargo.toml b/rust/Cargo.toml index e1c54341a..8c65fdbae 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -21,8 +21,6 @@ keywords = ["tui", "cli", "terminal", "ncurses", "ffi"] [dependencies] libc = {version = "0.2.80", default-features = false} cty = "0.2.1" -cstr_core = "0.2.2" -libc-print = "0.1.14" [build-dependencies] bindgen = ">= 0.55.1" diff --git a/rust/examples/direct-cursor.rs b/rust/examples/direct-cursor.rs index a859fdcd9..afa1b4900 100644 --- a/rust/examples/direct-cursor.rs +++ b/rust/examples/direct-cursor.rs @@ -1,7 +1,7 @@ use std::thread::sleep; use std::time::Duration; -use cstr_core::CString; +use std::ffi::CString; use libnotcurses_sys as nc; diff --git a/rust/examples/direct-image.rs b/rust/examples/direct-image.rs index 06135a3c4..7d177ade7 100644 --- a/rust/examples/direct-image.rs +++ b/rust/examples/direct-image.rs @@ -1,4 +1,4 @@ -use cstr_core::CString; +use std::ffi::CString; use libnotcurses_sys as nc; diff --git a/rust/examples/full-text.rs b/rust/examples/full-text.rs index 2e436a7ba..442a489b0 100644 --- a/rust/examples/full-text.rs +++ b/rust/examples/full-text.rs @@ -1,4 +1,4 @@ -//use cstr_core::CString; +//use std::ffi::Cstring; use libnotcurses_sys as nc; diff --git a/rust/src/lib.rs b/rust/src/lib.rs index 69057554c..a6fc47dc9 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -1,7 +1,6 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -#![no_std] #![allow(clippy::too_many_arguments)] pub mod bindings; diff --git a/rust/src/notcurses.rs b/rust/src/notcurses.rs index c4e3a04d5..bc88f8d24 100644 --- a/rust/src/notcurses.rs +++ b/rust/src/notcurses.rs @@ -217,7 +217,6 @@ pub fn notcurses_term_dim_yx(nc: &Notcurses, rows: &mut i32, cols: &mut i32) { #[cfg(test)] mod test { - use libc_print::*; use serial_test::serial; use crate::{notcurses_stop, Notcurses}; @@ -244,7 +243,7 @@ mod test { notcurses_stop(nc); assert![!res.is_null()]; - //libc_print!("[{}] ", res); + //print!("[{}] ", res); } } @@ -274,11 +273,11 @@ mod test { // as _IO_FILE struct; let mut debug0 = *file; - libc_println!("{:#?}", debug0); + println!("{:#?}", debug0); // as enum libc::FILE let mut debug1 = file as *mut _ as *mut libc::FILE; - libc_println!("{:#?}", debug1); + println!("{:#?}", debug1); } } @@ -289,7 +288,7 @@ mod test { let nc = Notcurses::new(); let res = crate::notcurses_canchangecolor(nc); notcurses_stop(nc); - libc_print!("[{}] ", res); + print!("[{}] ", res); } } @@ -300,7 +299,7 @@ mod test { let nc = Notcurses::new(); let res = crate::notcurses_canfade(nc); notcurses_stop(nc); - libc_print!("[{}] ", res); + print!("[{}] ", res); } } @@ -311,7 +310,7 @@ mod test { let nc = Notcurses::new(); let res = crate::notcurses_canopen_images(nc); notcurses_stop(nc); - libc_print!("[{}] ", res); + print!("[{}] ", res); } } @@ -322,7 +321,7 @@ mod test { let nc = Notcurses::new(); let res = crate::notcurses_canopen_videos(nc); notcurses_stop(nc); - libc_print!("[{}] ", res); + print!("[{}] ", res); } } @@ -333,7 +332,7 @@ mod test { let nc = Notcurses::new(); let res = crate::notcurses_cansixel(nc); notcurses_stop(nc); - libc_print!("[{}] ", res); + print!("[{}] ", res); } } @@ -344,7 +343,7 @@ mod test { let nc = Notcurses::new(); let res = crate::notcurses_cantruecolor(nc); notcurses_stop(nc); - libc_print!("[{}] ", res); + print!("[{}] ", res); } } @@ -355,7 +354,7 @@ mod test { let nc = Notcurses::new(); let res = crate::notcurses_canutf8(nc); notcurses_stop(nc); - libc_print!("[{}] ", res); + print!("[{}] ", res); } } diff --git a/rust/src/plane.rs b/rust/src/plane.rs index 887f40192..2d9f4c995 100644 --- a/rust/src/plane.rs +++ b/rust/src/plane.rs @@ -153,8 +153,7 @@ use core::{ ffi::c_void, ptr::{null, null_mut}, }; - -use cstr_core::CString; +use std::ffi::CString; use libc::free; use crate::{ diff --git a/rust/src/widgets/menu.rs b/rust/src/widgets/menu.rs index 2fd0db6db..35099b855 100644 --- a/rust/src/widgets/menu.rs +++ b/rust/src/widgets/menu.rs @@ -14,7 +14,7 @@ // ncmenu_selected // ncmenu_unroll -use cstr_core::CString; +use std::ffi::CString; use crate::{ ncmenu_create, diff --git a/rust/tests/notcurses.rs b/rust/tests/notcurses.rs index 3ed1e232f..b817bced9 100644 --- a/rust/tests/notcurses.rs +++ b/rust/tests/notcurses.rs @@ -1,7 +1,6 @@ use core::ptr::{null, null_mut}; -use cstr_core::{CStr, CString}; +use std::ffi::{CStr, CString}; -use libc_print::*; use serial_test::serial; // serialize tests w/ nc::notcurses_init() use libnotcurses_sys as nc; @@ -15,7 +14,7 @@ fn get_notcurses_version() { CStr::from_ptr(s) }; let r_str = c_str.to_str().unwrap(); - libc_println!("rust-bound notcurses v{}", r_str); + println!("rust-bound notcurses v{}", r_str); } #[test]