From 95628bef161ea612fa847244f79d453937616e7b Mon Sep 17 00:00:00 2001 From: Michael Angerman Date: Tue, 26 Oct 2021 13:45:10 -0700 Subject: [PATCH] sending off for JT to review --- crates/nu-command/src/filters/last.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/crates/nu-command/src/filters/last.rs b/crates/nu-command/src/filters/last.rs index 75ffd6fec1..c5b4f98640 100644 --- a/crates/nu-command/src/filters/last.rs +++ b/crates/nu-command/src/filters/last.rs @@ -35,6 +35,11 @@ impl Command for Last { ) -> Result { let rows: Option = call.opt(engine_state, stack, 0)?; + // This code works fine and does the correct + // calculation of the beginning_rows_to_skip + // but it can not currently be used because + // I am not able to clone the input + /* let vlength = length(input)?; dbg!(vlength); @@ -54,6 +59,17 @@ impl Command for Last { dbg!(beginning_rows_to_skip); */ + // This code works fine if I am able to get this value + // So for now I am hard coding this number + + // The above code successfully calculates this number + // and it all works if I was able to clone the input + + // it seems being able to + // clone the input is important + + // As we were able to do that prior to your changes... + let beginning_rows_to_skip = 2; match input {