fn print_welcome(&mut self) {
        let (term_width, _) = term_size::dimensions().unwrap();

        let max_msg_width = 93;

        let welcome = "Welcome to VM!";
        let help = format!("type '{}' for more information", HELP);
        let exit = "press Ctrl+D to exit";
        let version = format!("Version {}", env!("CARGO_PKG_VERSION"));

        let lines: Vec<&str> = WELCOME.split("\n").collect();

        // if the terminal window is too small, print out a more compact
        // version, putting the welcome message, help information and such
        // under the banner instead of to the side.
        if term_width < max_msg_width {
            println!("{}\n", WELCOME);
            println!("{} ({})", welcome, version);
            println!("{}, {}", help, exit);
        } else {
            println!("{}", lines[1]);
            println!("{}{}", lines[2], welcome);
            println!("{}", lines[3]);
            println!("{}{}", lines[4], help);
            println!("{}{}", lines[5], exit);
            println!("{}", lines[6]);
            println!("{}{}", lines[7], version);
            println!("");
        }
    }
// TODO: a bit much? maybe scale it down a little?
/// Print out Radish's welcome message.
a bit much. maybe scale it down a little.
Print out Radish's welcome message.
a bit much . maybe scale it down a little . Print out Radish ' s welcome message .
fn print_welcome(&mut self) {
        let (term_width, _) = term_size::dimensions().unwrap();
        let max_msg_width = 93;
        let welcome = "Welcome to VM!";
        let help = format!("type '{}' for more information", HELP);
        let exit = "press Ctrl+D to exit";
        let version = format!("Version {}", env!("CARGO_PKG_VERSION"));
        let lines: Vec<&str> = WELCOME.split("\n").collect();
        // if the terminal window is too small, print out a more compact
        // version, putting the welcome message, help information and such
        // under the banner instead of to the side.
        if term_width < max_msg_width {
            println!("{}\n", WELCOME);
            println!("{} ({})", welcome, version);
            println!("{}, {}", help, exit);
        } else {
            println!("{}", lines[1]);
            println!("{}{}", lines[2], welcome);
            println!("{}", lines[3]);
            println!("{}{}", lines[4], help);
            println!("{}{}", lines[5], exit);
            println!("{}", lines[6]);
            println!("{}{}", lines[7], version);
            println!("");
        }
    }
fn print_welcome ( & mut self ) { let ( term_width , _ ) = term_size :: dimensions ( ) . unwrap ( ) ; let max_msg_width = 93 ; let welcome = " " ; let help = format ! ( " " HELP ) ; let exit = " " ; let version = format ! ( " " env ( " " ) ) ; let lines : Vec < & str > = WELCOME . split ( " \n " ) . collect ( ) ; // if the terminal window is too small, print out a more compact // version, putting the welcome message, help information and such // under the banner instead of to the side. if term_width < max_msg_width { println ! ( " \n " WELCOME ) ; println ! ( " " welcome version ) ; println ! ( " " help exit ) ; } else { println ! ( " " lines [ 1 ] ) ; println ! ( " " lines [ 2 ] welcome ) ; println ! ( " " lines [ 3 ] ) ; println ! ( " " lines [ 4 ] help ) ; println ! ( " " lines [ 5 ] exit ) ; println ! ( " " lines [ 6 ] ) ; println ! ( " " lines [ 7 ] version ) ; println ! ( " " ) ; } }
TODO: a bit much?
TODO : a bit much?
&mut self