From 919d55f3fc1c74743db44050d1045799901e884e Mon Sep 17 00:00:00 2001 From: Alex Ionescu Date: Fri, 8 Nov 2024 07:37:38 +0100 Subject: [PATCH] Remove unneeded clones in `select` (#14283) # Description This PR removes some unneeded `clone()` calls in the implementation of `select`. # User-Facing Changes There are no user-facing changes. --- crates/nu-command/src/filters/select.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/nu-command/src/filters/select.rs b/crates/nu-command/src/filters/select.rs index 670def2d09..71a2389c79 100644 --- a/crates/nu-command/src/filters/select.rs +++ b/crates/nu-command/src/filters/select.rs @@ -64,12 +64,12 @@ produce a table, a list will produce a list, and a record will produce a record. Value::String { val, .. } => { let cv = CellPath { members: vec![PathMember::String { - val: val.clone(), + val, span: *col_span, optional: false, }], }; - new_columns.push(cv.clone()); + new_columns.push(cv); } Value::Int { val, internal_span } => { if val < 0 { @@ -87,7 +87,7 @@ produce a table, a list will produce a list, and a record will produce a record. optional: false, }], }; - new_columns.push(cv.clone()); + new_columns.push(cv); } x => { return Err(ShellError::CantConvert {