Skip to content

Commit ac48fa4

Browse files
committed
Fix: lock stdin when reading from it buffered
Buffered reading from stdin now needs to lock stdin. This is to solve rust-lang/rust#14434 which was a race condition on buffered reads from stdin. This change is to conform to the new API submitted as part of rust-lang/rust#19416.
1 parent 267cd4f commit ac48fa4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ mod test;
1212

1313
#[cfg(not(test))]
1414
fn main() {
15-
for e_line in std::io::stdin().lines() {
15+
for e_line in std::io::stdin().lock().lines() {
1616
match e_line {
1717
Ok(line) => {
1818
let mut cur_puzzle = create_puzzle(line.as_slice());

0 commit comments

Comments
 (0)