ignite 0.1.6

ignite serves the role as a "batteries included" addon to stdlib providing useful stuff and higher level functions along with abstractions.
Documentation
use std::iter;
use terminal_size::terminal_size;

/// A struct containing some basic terminal info to serve as a basis for CLI aesthetics.
#[derive(Debug, Clone)]
pub struct CLI {
    term_width: u32,
    term_height: u32,
}

impl CLI {
    /// Create a new CLI struct.
    #[inline]
    pub fn new() -> CLI {
        // Get a tuple of the terminal dimensions.
        let term_size = terminal_size().unwrap();

        CLI {
            term_width: (term_size.0).0 as u32,
            term_height: (term_size.1).0 as u32,
        }
    }

    /// Update the terminal dimensions.
    pub fn update(&mut self) {
        // Get a tuple of the terminal dimensions.
        let term_size = terminal_size().unwrap();

        self.term_width = (term_size.0).0 as u32;
        self.term_height = (term_size.1).0 as u32;
    }

    /// Create a horizontal border with a length multiplier. A multiplier of 0.5 would for example result in a border
    /// half the length of the terminal.
    pub fn border_horizontal(&self, border_char: char, length_mult: f32) -> String {
        // Calculate the final width of the border.
        let eff_width = (self.term_width as f32 * length_mult) as usize;

        // Create a infinite generator of the character provided and take as many as necessary.
        let border = iter::repeat(border_char.to_string()).take(eff_width).collect::<String>();

        border
    }
}