From 9720424884d67d61fd4ab7cbcefa2bfcc21d03e1 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Tue, 11 Apr 2023 16:50:26 +0200 Subject: Fix duplicate error message for destructuring --- src/eval/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/eval/mod.rs') diff --git a/src/eval/mod.rs b/src/eval/mod.rs index ca69b2d8..55d2a734 100644 --- a/src/eval/mod.rs +++ b/src/eval/mod.rs @@ -1461,16 +1461,16 @@ impl Eval for ast::ForLoop { match (pattern.kind(), iter.clone()) { (ast::PatternKind::Ident(_), Value::Str(string)) => { - // iterate over characters of string + // Iterate over graphemes of string. iter!(for pattern in string.as_str().graphemes(true)); } (_, Value::Dict(dict)) => { - // iterate over keys of dict + // Iterate over pairs of dict. iter!(for pattern in dict.pairs()); } (_, Value::Array(array)) => { - // iterate over values of array and allow destructuring - iter!(for pattern in array.into_iter()); + // Iterate over values of array. + iter!(for pattern in array); } (ast::PatternKind::Ident(_), _) => { bail!(self.iter().span(), "cannot loop over {}", iter.type_name()); -- cgit v1.2.3