From a064400b6f258688f47804de53723e2dfaf8561a Mon Sep 17 00:00:00 2001 From: Alexandre Bury Date: Wed, 21 Sep 2016 11:57:19 -0700 Subject: [PATCH] Add unsafe block around `ncurses::stdscr` One more reason to avoid ncurses --- src/backend/curses.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/backend/curses.rs b/src/backend/curses.rs index ea50456..7bb8bc0 100644 --- a/src/backend/curses.rs +++ b/src/backend/curses.rs @@ -12,19 +12,19 @@ impl backend::Backend for NcursesBackend { ::std::env::set_var("ESCDELAY", "25"); ncurses::setlocale(ncurses::LcCategory::all, ""); ncurses::initscr(); - ncurses::keypad(ncurses::stdscr, true); + ncurses::keypad(unsafe { ncurses::stdscr }, true); ncurses::noecho(); ncurses::cbreak(); ncurses::start_color(); ncurses::curs_set(ncurses::CURSOR_VISIBILITY::CURSOR_INVISIBLE); - ncurses::wbkgd(ncurses::stdscr, + ncurses::wbkgd(unsafe { ncurses::stdscr }, ncurses::COLOR_PAIR(ColorStyle::Background.id())); } fn screen_size() -> (usize, usize) { let mut x: i32 = 0; let mut y: i32 = 0; - ncurses::getmaxyx(ncurses::stdscr, &mut y, &mut x); + ncurses::getmaxyx(unsafe { ncurses::stdscr }, &mut y, &mut x); (x as usize, y as usize) }