Skip to content

Commit 162c972

Browse files
committed
Split usage of stdin() into multiple lets
Due to the following bug in rustc lifetime inferrer: rust-lang/rust#21114
1 parent e864442 commit 162c972

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ extern crate selecta;
55

66
use getopts::{optopt,getopts};
77
use std::cmp::min;
8+
use std::old_io::stdio;
89

910
use selecta::search::Search;
1011
use selecta::tty::IO;
@@ -51,7 +52,9 @@ fn get_args() -> Vec<String> {
5152
}
5253

5354
fn read_lines() -> Vec<String> {
54-
std::old_io::stdio::stdin().lock().lines().map( |line| {
55+
let mut stdin = stdio::stdin();
56+
let mut reader = stdin.lock();
57+
reader.lines().map( |line| {
5558
line.unwrap().trim().to_string()
5659
}).collect()
5760
}

0 commit comments

Comments
 (0)