From 8ca6e6559ef3e8276e28890f81e0b679d804c563 Mon Sep 17 00:00:00 2001 From: Thomas Habets Date: Sat, 30 Mar 2024 17:18:56 +0000 Subject: [PATCH] Remove instr/mvinstr: If it's impossible to use correctly, it should be removed Bug #209 --- src/lib.rs | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index e9f11fc..53b3a2c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -593,26 +593,6 @@ pub fn insstr(s: &str) -> i32 } -pub fn instr(s: &mut String) -> i32 -{ - /* XXX: This is probably broken. */ - unsafe - { - let buf = s.as_bytes().as_ptr(); - let ret = ll::instr(mem::transmute(buf)); - - let capacity = s.capacity(); - match s.find('\0') - { - Some(index) => s.as_mut_vec().set_len(index as usize), - None => s.as_mut_vec().set_len(capacity), - } - - ret - } -} - - pub fn intrflush(w: WINDOW, bf: bool) -> i32 { unsafe { ll::intrflush(w, bf as ll::c_bool) } } @@ -827,14 +807,6 @@ pub fn mvinsstr(y: i32, x: i32, s: &str) -> i32 } -pub fn mvinstr(y: i32, x: i32, s: &mut String) -> i32 -{ - if mv(y, x) == ERR - { return ERR; } - instr(s) -} - - pub fn mvprintw(y: i32, x: i32, s: &str) -> Result { if mv(y, x) == ERR