/// Read from stdin, and return a standard error if anything goes wrong
Read from stdin, and return a standard error if anything goes wrong
Read from stdin and return a standard error if anything goes wrong
pub fn read_from_stdin() -> Result<String, StdinReadError> {
    let stdin = stdin();
    let mut reader = BufReader::new(stdin.lock());
    let mut buffer: Vec<u8> = Vec::new();
    reader
        .read_to_end(&mut buffer)
        .map_err(|_| StdinReadError)?;
    let result = std::str::from_utf8(&buffer).map_err(|_| StdinReadError)?;
    Ok(result.into())
}
pub fn read_from_stdin ( ) -> Result < String , StdinReadError > { let stdin = stdin ( ) ; let mut reader = BufReader :: new ( stdin . lock ( ) ) ; let mut buffer : Vec < u8 > = Vec :: new ( ) ; reader . read_to_end ( & mut buffer ) . map_err ( | _ | StdinReadError ) ? ; let result = std :: str :: from_utf8 ( & buffer ) . map_err ( | _ | StdinReadError ) ? ; Ok ( result . into ( ) ) }
Read from stdin, and return a standard error if anything goes wrong
Read from stdin and return a standard error if anything goes wrong