fn terminal_size_using_env() -> Option<(Width, Height)> {
    let get_u16_from_env = |x: &str| -> u16 {
        if let Some(v) = env::var_os(x) {
            v.into_string().unwrap()
                .parse::<u16>().unwrap()
        } else {
            0
        }
    };
    let c = get_u16_from_env("COLUMNS");
    let r = get_u16_from_env("LINES");

    if r == 0 && c == 0 {
        None
    } else {
        return Some((Width(c), Height(r)))
    }
}
/// Returns the size of the terminal using system env:
/// COLUMNS and LINES
///
/// If both env are 0, returns `None`
Returns the size of the terminal using system env:
COLUMNS and LINES

If both env are 0, returns `None`
Returns the size of the terminal using system env : COLUMNS and LINES If both env are 0 returns ` None `
fn terminal_size_using_env() -> Option<(Width, Height)> {
    let get_u16_from_env = |x: &str| -> u16 {
        if let Some(v) = env::var_os(x) {
            v.into_string().unwrap()
                .parse::<u16>().unwrap()
        } else {
            0
        }
    };
    let c = get_u16_from_env("COLUMNS");
    let r = get_u16_from_env("LINES");
    if r == 0 && c == 0 {
        None
    } else {
        return Some((Width(c), Height(r)))
    }
}
fn terminal_size_using_env ( ) -> Option < ( Width , Height ) > { let get_u16_from_env = | x : & str | -> u16 { if let Some ( v ) = env :: var_os ( x ) { v . into_string ( ) . unwrap ( ) . parse :: < u16 > ( ) . unwrap ( ) } else { 0 } } ; let c = get_u16_from_env ( " " ) ; let r = get_u16_from_env ( " " ) ; if r == 0 && c == 0 { None } else { return Some ( ( Width ( c ) , Height ( r ) ) ) } }
Returns the size of the terminal using system env:
COLUMNS and LINES
Returns the size of the terminal using system env : COLUMNS and LINES