sol_readln 1.0.1

A simple alternative to Rust's standard library's method of reading input from the terminal. (Made for learning and people coming from higher level languages.)
Documentation
  • Coverage
  • 75%
    3 out of 4 items documented0 out of 3 items with examples
  • Size
  • Source code size: 2.83 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.05 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • mateusqqfoi

SOL_READLN

A simple alternative to Rust's standard library's method of reading input from the terminal + a print function that automatically flushes the stdout like in other languages.

(Made for learning and people coming from higher level languages.)

Usage

use sol_readln::*;

fn main() {
    /// Prompts the user (terminal) for input, returns it as a String.
    /// Panics if it could not read it.
    let input = readln();

    /// Prompts the user (terminal) for input and returns a Result.
    /// Ok(input) where input is a String or
    /// Err(error) where error is a std::io::error:Error.
    let input = read_line();

    /// Prints and flushes the stdout, will panic if it isn't possible.
    /// Simple higher-level alternative, works as expected in other
    /// higher-level languages.
    print("Hello, sol!");
}