Skip to content

Commit

Permalink
Remove instr/mvinstr: If it's impossible to use correctly, it should …
Browse files Browse the repository at this point in the history
…be removed

Bug jeaye#209
  • Loading branch information
ThomasHabets committed Mar 30, 2024
1 parent 9a9d1d7 commit 8ca6e65
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) } }

Expand Down Expand Up @@ -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<i32, std::ffi::NulError>
{
if mv(y, x) == ERR
Expand Down

0 comments on commit 8ca6e65

Please sign in to comment.