From 90b94fa805c82996276e44d67e8b386b68e268b1 Mon Sep 17 00:00:00 2001 From: Stephen Waits Date: Sat, 12 Dec 2020 07:24:40 -0800 Subject: [PATCH] nicer times() Signed-off-by: Stephen Waits --- src/utils.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils.rs b/src/utils.rs index f0bb661..e5fbfd1 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -1,7 +1,7 @@ // ==== utilities use anyhow::Result; -use std::{fs, iter}; +use std::fs; pub fn read_i64s(filename: &str) -> Result> { Ok(read_file(filename)? @@ -25,7 +25,7 @@ pub fn parse_usize_in_range(s: &str, min: usize, max: usize) -> Option { #[allow(dead_code)] pub fn times(n: usize) -> impl Iterator { - iter::repeat(()).take(n).enumerate().map(|(i, _)| i) + (0..n).into_iter() } // Lexicographic combinations.