Iterator reference parameters.

This commit is contained in:
Stephen Chung
2021-06-21 19:12:28 +08:00
parent 3b345acebf
commit 2342777a13
5 changed files with 33 additions and 64 deletions

View File

@@ -191,7 +191,7 @@ impl<'e> ParseState<'e> {
.iter()
.rev()
.enumerate()
.find(|&(_, n)| *n == name)
.find(|&(_, n)| n == name)
.and_then(|(i, _)| NonZeroUsize::new(i + 1))
}
@@ -1070,8 +1070,8 @@ fn parse_primary(
let (expr, func) = parse_anon_fn(input, &mut new_state, lib, settings)?;
#[cfg(not(feature = "no_closure"))]
new_state.external_vars.iter().for_each(|(closure, pos)| {
state.access_var(closure, *pos);
new_state.external_vars.iter().for_each(|(closure, &pos)| {
state.access_var(closure, pos);
});
let hash_script = calc_fn_hash(&func.name, func.params.len());