Closed
Description
Next code:
use std::io::{Read, stdin};
fn main() {
stdin().bytes().next()
}
Gives this compile error:
E:\Downloads\Git\collectionScripts\rust
[master +2 ~1 -0 !] > rustc.exe .\temp.rs
.\temp.rs:4:5: 4:27 error: mismatched types:
expected `()`,
found `core::option::Option<core::result::Result<u8, std::io::error::Error>>`
(expected (),
found enum `core::option::Option`) [E0308]
.\temp.rs:4 stdin().bytes().next()
^~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
Which is a bit misleading as there is actually we're missing either ; or unwrap() i think?
Rust version:
rustc 1.0.0-beta.4 (850151a75 2015-04-30) (built 2015-05-01)
binary: rustc
commit-hash: 850151a75709f146addd30bbbf1f23d384f0b381
commit-date: 2015-04-30
build-date: 2015-05-01
host: x86_64-pc-windows-gnu
release: 1.0.0-beta.4