Use functional paradigm for file reading.
This commit is contained in:
parent
df7017518e
commit
374bc02b50
@ -50,12 +50,9 @@ fn main()
|
|||||||
{
|
{
|
||||||
let in_file = File::open(opts.import.unwrap()).unwrap();
|
let in_file = File::open(opts.import.unwrap()).unwrap();
|
||||||
let reader = BufReader::new(in_file);
|
let reader = BufReader::new(in_file);
|
||||||
for line in reader.lines()
|
reader.lines().into_iter().for_each(|x| {
|
||||||
{
|
primes.push_back(x.unwrap().parse().unwrap());
|
||||||
let line = line.unwrap();
|
});
|
||||||
let aux:u64 = line.parse().unwrap();
|
|
||||||
primes.push_back(aux);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if opts.test
|
if opts.test
|
||||||
|
Loading…
Reference in New Issue
Block a user