Skip to content

Commit

Permalink
Split usage of stdin() into multiple lets
Browse files Browse the repository at this point in the history
Due to the following bug in rustc lifetime inferrer:
rust-lang/rust#21114
  • Loading branch information
felipesere committed Feb 13, 2015
1 parent e864442 commit 162c972
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ extern crate selecta;

use getopts::{optopt,getopts};
use std::cmp::min;
use std::old_io::stdio;

use selecta::search::Search;
use selecta::tty::IO;
Expand Down Expand Up @@ -51,7 +52,9 @@ fn get_args() -> Vec<String> {
}

fn read_lines() -> Vec<String> {
std::old_io::stdio::stdin().lock().lines().map( |line| {
let mut stdin = stdio::stdin();
let mut reader = stdin.lock();
reader.lines().map( |line| {
line.unwrap().trim().to_string()
}).collect()
}

0 comments on commit 162c972

Please sign in to comment.