Skip to content

Book: Standard Input is out-of-date #23760

@KingOfThePirates

Description

@KingOfThePirates

http://doc.rust-lang.org/book/standard-input.html

When running the old I/O Standard library, I get an error that the compiler won't admit.

Example:

use std::old_io; // error: use of unstable library feature 'old_io'
                 // warning: use of deprecated item, #[warn(deprecated)] on by default
fn main() {
    println!("Type something!");

    let input = old_io::stdin().read_line().ok().expect("Failed to read line"); // error: use of unstable library feature 'old_io'
                                                                                // error: use of unstable library feature 'old_io'
                                                                                // warning: use of deprecated item, #[warn(deprecated)] on by default
                                                                                // warning: use of deprecated item, #[warn(deprecated)] on by default
    println!("{}", input);

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions