mirror of
https://github.com/nushell/nushell.git
synced 2024-11-15 21:14:40 +01:00
code cleanup
This commit is contained in:
parent
656e86a7ca
commit
4b31fe1924
@ -37,58 +37,11 @@ impl Command for Last {
|
||||
let vlen: i64 = v.len() as i64;
|
||||
let beginning_rows_to_skip = rows_to_skip(vlen, rows);
|
||||
|
||||
/*
|
||||
let end_rows_desired = if let Some(quantity) = rows {
|
||||
quantity
|
||||
} else {
|
||||
1
|
||||
};
|
||||
|
||||
let beginning_rows_to_skip = if end_rows_desired < v.len() {
|
||||
v.len() - end_rows_desired
|
||||
} else {
|
||||
0
|
||||
};
|
||||
*/
|
||||
|
||||
let iter = v
|
||||
.into_iter()
|
||||
.skip(beginning_rows_to_skip.try_into().unwrap());
|
||||
|
||||
//let iter = v.into_iter().skip(beginning_rows_to_skip);
|
||||
|
||||
/*
|
||||
let iter_count: i64 = input.into_iter().count() as i64;
|
||||
let beginning_rows_to_skip = rows_to_skip(iter_count, rows);
|
||||
dbg!(beginning_rows_to_skip);
|
||||
*/
|
||||
// let beginning_rows_to_skip = 3;
|
||||
|
||||
/*
|
||||
match input {
|
||||
PipelineData::Stream(stream) => {
|
||||
dbg!("Stream");
|
||||
Ok(stream
|
||||
.skip(beginning_rows_to_skip.try_into().unwrap())
|
||||
.into_pipeline_data())
|
||||
}
|
||||
PipelineData::Value(Value::List { vals, .. }) => {
|
||||
dbg!("Value");
|
||||
Ok(vals
|
||||
.into_iter()
|
||||
.skip(beginning_rows_to_skip.try_into().unwrap())
|
||||
.into_pipeline_data())
|
||||
}
|
||||
_ => {
|
||||
dbg!("Fall to the bottom");
|
||||
Ok(PipelineData::Value(Value::Nothing { span: call.head }))
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
Ok(iter.into_pipeline_data())
|
||||
|
||||
// Ok(PipelineData::Value(Value::Nothing { span: call.head }))
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user