From a2c91757cf8e50b4acbf0be8b1de5bb25ff312da Mon Sep 17 00:00:00 2001 From: _ <_@_> Date: Sun, 24 Sep 2023 17:42:56 -0500 Subject: [PATCH] :rotating_light: clippy pass --- src/state.rs | 4 ++-- src/tests.rs | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/state.rs b/src/state.rs index b7b3a68..8abf8fa 100644 --- a/src/state.rs +++ b/src/state.rs @@ -120,14 +120,14 @@ impl State { let env = BTreeMap::from_iter ([ ("arg", Value::BogusArg (arg)), ("print", Value::BogusPrint), - ].map (|(k, v)| (k.to_string (), v)).into_iter ()); + ].map (|(k, v)| (k.to_string (), v))); vec! [ Value::BogusEnv (env), ] } - pub fn execute_chunk (&mut self, chunk: &Chunk, upvalues: &Vec ) + pub fn execute_chunk (&mut self, chunk: &Chunk, upvalues: &[Value]) -> Vec { let max_iters = 2000; diff --git a/src/tests.rs b/src/tests.rs index 491b09d..4b32591 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -38,6 +38,7 @@ fn floats () { for (arg, expected) in [ (vec! ["_exe_name"], vec! [3.5.into ()]), + (vec! ["_exe_name", " "], vec! [3.5.into ()]), ] { let mut vm = State::default (); let upvalues = State::upvalues_from_args (arg.into_iter ().map (|s| s.to_string ())); @@ -85,7 +86,7 @@ fn is_93 () { "print", "it's 93", "it's not 93", - ].into_iter ().map (|s| Value::from (s)).collect (), + ].into_iter ().map (Value::from).collect (), }; for (arg, expected) in [