From 1a1b740c38cfbadff4cd985ee925ac024627d2b9 Mon Sep 17 00:00:00 2001 From: Joe Wilm Date: Mon, 12 Dec 2016 09:31:48 -0800 Subject: Remove need for Rc> usage This adds a trait OnResize and a separate method handle_resize to the display. Instead of having a callback to receive resize events, a list of &mut OnResize are passed to this new method. Doing this allowed the only RefCell usage in the codebase to be removed :). --- src/term/mod.rs | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'src/term') diff --git a/src/term/mod.rs b/src/term/mod.rs index 523fcb62..fb31af9b 100644 --- a/src/term/mod.rs +++ b/src/term/mod.rs @@ -23,20 +23,6 @@ use grid::{Grid, ClearRegion}; use index::{Cursor, Column, Line}; use ansi::{Color, NamedColor}; -use tty::ToWinsize; -use libc::{self, winsize}; - -impl<'a> ToWinsize for &'a SizeInfo { - fn to_winsize(&self) -> winsize { - winsize { - ws_row: self.lines().0 as libc::c_ushort, - ws_col: self.cols().0 as libc::c_ushort, - ws_xpixel: self.width as libc::c_ushort, - ws_ypixel: self.height as libc::c_ushort, - } - } -} - pub mod cell; pub use self::cell::Cell; -- cgit