fn try_resize(&mut self, width: u32, height: u32) {
        let size = crossterm::terminal::size().unwrap();
        if (size.0 as u32) < width || (size.1 as u32) < height {
            execute!(self.stdout, 
                crossterm::terminal::SetSize(width as u16, height as u16),
                crossterm::terminal::SetSize(width as u16, height as u16)
            ).ok();
            self.resize(width, height);
        }
        if crossterm::terminal::size().unwrap() < (width as u16, height as u16) {
            panic!("Your terminal must have at least a width and height of {}x{} characters. Currently has {}x{}", width, height, size.0, size.1)
        }
    }
/// Try to resize the terminal to match the asked width and height at minimum
Try to resize the terminal to match the asked width and height at minimum
Try to resize the terminal to match the asked width and height at minimum
fn try_resize(&mut self, width: u32, height: u32) {
        let size = crossterm::terminal::size().unwrap();
        if (size.0 as u32) < width || (size.1 as u32) < height {
            execute!(self.stdout, 
                crossterm::terminal::SetSize(width as u16, height as u16),
                crossterm::terminal::SetSize(width as u16, height as u16)
            ).ok();
            self.resize(width, height);
        }
        if crossterm::terminal::size().unwrap() < (width as u16, height as u16) {
            panic!("Your terminal must have at least a width and height of {}x{} characters. Currently has {}x{}", width, height, size.0, size.1)
        }
    }
fn try_resize ( & mut self , width : u32 , height : u32 ) { let size = crossterm :: terminal :: size ( ) . unwrap ( ) ; if ( size . 0 as u32 ) < width || ( size . 1 as u32 ) < height { execute ! ( self stdout crossterm terminal SetSize ( width as u16 height as u16 ) crossterm terminal SetSize ( width as u16 height as u16 ) ) . ok ( ) ; self . resize ( width , height ) ; } if crossterm :: terminal :: size ( ) . unwrap ( ) < ( width as u16 , height as u16 ) { panic ! ( " " width height size 0 size 1 ) } }
Try to resize the terminal to match the asked width and height at minimum
Try to resize the terminal to match the asked width and height at minimum
&mut self
width
u32
height
u32
&mut self
width
u32
height
u32