From 29d97b94a804c00b7f22210f4c7e3d9c93355ad8 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 11 Apr 2024 10:13:10 -0600 Subject: [PATCH] ptest: Use 1-based indices for tests Adjust the printed numbers, as well as the values to `--test` so that the tests are numbered starting from 1 instead of zero. Signed-off-by: David Brown --- ptest/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ptest/src/main.rs b/ptest/src/main.rs index b0d7e66d..9a75ccb7 100644 --- a/ptest/src/main.rs +++ b/ptest/src/main.rs @@ -264,7 +264,7 @@ impl Matrix { /// Print out all of the feature sets. fn show(&self) { for (i, feature) in self.envs.iter().enumerate() { - println!("{:3}. {}", i, feature.simple_textual()); + println!("{:3}. {}", i + 1, feature.simple_textual()); } } @@ -276,7 +276,7 @@ impl Matrix { .envs .into_iter() .enumerate() - .filter(|(ind, _)| pick.contains(ind)) + .filter(|(ind, _)| pick.contains(&(ind + 1))) .map(|(_, item)| item) .collect(); Matrix { envs }