From f41c93b2d3c803b29e2641ab764fb4efa1a5c3d5 Mon Sep 17 00:00:00 2001 From: nibon7 Date: Fri, 17 Nov 2023 23:15:55 +0800 Subject: [PATCH] Apply nightly clippy fixes (#11083) # Description Clippy fixes for rust 1.76.0-nightly # User-Facing Changes N/A # Tests + Formatting # After Submitting --- crates/nu-cli/src/completions/completer.rs | 2 +- crates/nu-cli/src/util.rs | 2 +- crates/nu-cli/tests/completions.rs | 10 ++++---- .../src/dataframe/eager/drop.rs | 2 +- .../src/dataframe/eager/sql_context.rs | 6 ++--- .../src/dataframe/values/nu_dataframe/mod.rs | 2 +- .../src/dataframe/values/utils.rs | 4 ++-- crates/nu-command/src/filters/group_by.rs | 2 +- crates/nu-command/src/filters/insert.rs | 2 +- crates/nu-command/src/filters/reject.rs | 2 +- crates/nu-command/src/filters/select.rs | 2 +- crates/nu-command/src/filters/transpose.rs | 2 +- crates/nu-command/src/filters/update.rs | 2 +- crates/nu-command/src/filters/upsert.rs | 2 +- crates/nu-command/src/formats/from/nuon.rs | 2 +- crates/nu-command/src/math/reducers.rs | 4 ++-- crates/nu-explore/src/nu_common/mod.rs | 2 +- crates/nu-explore/src/views/record/mod.rs | 2 +- crates/nu-json/README.md | 2 +- crates/nu-lsp/src/lib.rs | 2 +- crates/nu-parser/src/parse_keywords.rs | 22 ++++++++--------- crates/nu-parser/src/parser.rs | 6 ++--- crates/nu-protocol/src/ast/expression.rs | 24 +++++++++---------- crates/nu-protocol/src/engine/engine_state.rs | 3 +-- src/command.rs | 4 ++-- 25 files changed, 57 insertions(+), 58 deletions(-) diff --git a/crates/nu-cli/src/completions/completer.rs b/crates/nu-cli/src/completions/completer.rs index 376075131..0b1ac3f87 100644 --- a/crates/nu-cli/src/completions/completer.rs +++ b/crates/nu-cli/src/completions/completer.rs @@ -67,7 +67,7 @@ impl NuCompleter { let mut callee_stack = stack.gather_captures(&self.engine_state, &block.captures); // Line - if let Some(pos_arg) = block.signature.required_positional.get(0) { + if let Some(pos_arg) = block.signature.required_positional.first() { if let Some(var_id) = pos_arg.var_id { callee_stack.add_var( var_id, diff --git a/crates/nu-cli/src/util.rs b/crates/nu-cli/src/util.rs index e28367d4c..614331d1e 100644 --- a/crates/nu-cli/src/util.rs +++ b/crates/nu-cli/src/util.rs @@ -111,7 +111,7 @@ fn gather_env_vars( let name = if let Some(Token { contents: TokenContents::Item, span, - }) = parts.get(0) + }) = parts.first() { let mut working_set = StateWorkingSet::new(engine_state); let bytes = working_set.get_span_contents(*span); diff --git a/crates/nu-cli/tests/completions.rs b/crates/nu-cli/tests/completions.rs index da9be1812..e6528031f 100644 --- a/crates/nu-cli/tests/completions.rs +++ b/crates/nu-cli/tests/completions.rs @@ -122,14 +122,14 @@ fn dotnu_completions() { let suggestions = completer.complete(&completion_str, completion_str.len()); assert_eq!(1, suggestions.len()); - assert_eq!("custom_completion.nu", suggestions.get(0).unwrap().value); + assert_eq!("custom_completion.nu", suggestions.first().unwrap().value); // Test use completion let completion_str = "use ".to_string(); let suggestions = completer.complete(&completion_str, completion_str.len()); assert_eq!(1, suggestions.len()); - assert_eq!("custom_completion.nu", suggestions.get(0).unwrap().value); + assert_eq!("custom_completion.nu", suggestions.first().unwrap().value); } #[test] @@ -141,7 +141,7 @@ fn external_completer_trailing_space() { let suggestions = run_external_completion(block, &input); assert_eq!(3, suggestions.len()); - assert_eq!("gh", suggestions.get(0).unwrap().value); + assert_eq!("gh", suggestions.first().unwrap().value); assert_eq!("alias", suggestions.get(1).unwrap().value); assert_eq!("", suggestions.get(2).unwrap().value); } @@ -153,7 +153,7 @@ fn external_completer_no_trailing_space() { let suggestions = run_external_completion(block, &input); assert_eq!(2, suggestions.len()); - assert_eq!("gh", suggestions.get(0).unwrap().value); + assert_eq!("gh", suggestions.first().unwrap().value); assert_eq!("alias", suggestions.get(1).unwrap().value); } @@ -164,7 +164,7 @@ fn external_completer_pass_flags() { let suggestions = run_external_completion(block, &input); assert_eq!(3, suggestions.len()); - assert_eq!("gh", suggestions.get(0).unwrap().value); + assert_eq!("gh", suggestions.first().unwrap().value); assert_eq!("api", suggestions.get(1).unwrap().value); assert_eq!("--", suggestions.get(2).unwrap().value); } diff --git a/crates/nu-cmd-dataframe/src/dataframe/eager/drop.rs b/crates/nu-cmd-dataframe/src/dataframe/eager/drop.rs index dbf36d6fe..8fc1ed1c0 100644 --- a/crates/nu-cmd-dataframe/src/dataframe/eager/drop.rs +++ b/crates/nu-cmd-dataframe/src/dataframe/eager/drop.rs @@ -68,7 +68,7 @@ fn command( let df = NuDataFrame::try_from_pipeline(input, call.head)?; let new_df = col_string - .get(0) + .first() .ok_or_else(|| { ShellError::GenericError( "Empty names list".into(), diff --git a/crates/nu-cmd-dataframe/src/dataframe/eager/sql_context.rs b/crates/nu-cmd-dataframe/src/dataframe/eager/sql_context.rs index 42ab272c2..be01e6e4b 100644 --- a/crates/nu-cmd-dataframe/src/dataframe/eager/sql_context.rs +++ b/crates/nu-cmd-dataframe/src/dataframe/eager/sql_context.rs @@ -29,7 +29,7 @@ impl SQLContext { fn execute_select(&self, select_stmt: &Select) -> Result { // Determine involved dataframe // Implicit join require some more work in query parsers, Explicit join are preferred for now. - let tbl = select_stmt.from.get(0).ok_or_else(|| { + let tbl = select_stmt.from.first().ok_or_else(|| { PolarsError::ComputeError(ErrString::from("No table found in select statement")) })?; let mut alias_map = HashMap::new(); @@ -37,7 +37,7 @@ impl SQLContext { TableFactor::Table { name, alias, .. } => { let tbl_name = name .0 - .get(0) + .first() .ok_or_else(|| { PolarsError::ComputeError(ErrString::from( "No table found in select statement", @@ -182,7 +182,7 @@ impl SQLContext { )) } else { let ast = ast - .get(0) + .first() .ok_or_else(|| PolarsError::ComputeError(ErrString::from("No statement found")))?; Ok(match ast { Statement::Query(query) => { diff --git a/crates/nu-cmd-dataframe/src/dataframe/values/nu_dataframe/mod.rs b/crates/nu-cmd-dataframe/src/dataframe/values/nu_dataframe/mod.rs index 9e09a735c..6e27296b6 100644 --- a/crates/nu-cmd-dataframe/src/dataframe/values/nu_dataframe/mod.rs +++ b/crates/nu-cmd-dataframe/src/dataframe/values/nu_dataframe/mod.rs @@ -325,7 +325,7 @@ impl NuDataFrame { let series = self .df .get_columns() - .get(0) + .first() .expect("We have already checked that the width is 1"); Ok(series.clone()) diff --git a/crates/nu-cmd-dataframe/src/dataframe/values/utils.rs b/crates/nu-cmd-dataframe/src/dataframe/values/utils.rs index abc191e06..eb4805430 100644 --- a/crates/nu-cmd-dataframe/src/dataframe/values/utils.rs +++ b/crates/nu-cmd-dataframe/src/dataframe/values/utils.rs @@ -11,7 +11,7 @@ pub(crate) fn convert_columns( ) -> Result<(Vec>, Span), ShellError> { // First column span let mut col_span = columns - .get(0) + .first() .ok_or_else(|| { ShellError::GenericError( "Empty column list".into(), @@ -54,7 +54,7 @@ pub(crate) fn convert_columns_string( ) -> Result<(Vec, Span), ShellError> { // First column span let mut col_span = columns - .get(0) + .first() .ok_or_else(|| { ShellError::GenericError( "Empty column list".into(), diff --git a/crates/nu-command/src/filters/group_by.rs b/crates/nu-command/src/filters/group_by.rs index 9d8b35416..b818c45fa 100644 --- a/crates/nu-command/src/filters/group_by.rs +++ b/crates/nu-command/src/filters/group_by.rs @@ -271,7 +271,7 @@ fn group_closure( )); } - let value = match collection.get(0) { + let value = match collection.first() { Some(Value::Error { .. }) | None => Value::string(error_key, span), Some(return_value) => return_value.clone(), }; diff --git a/crates/nu-command/src/filters/insert.rs b/crates/nu-command/src/filters/insert.rs index f207ef4ef..60ceb12f2 100644 --- a/crates/nu-command/src/filters/insert.rs +++ b/crates/nu-command/src/filters/insert.rs @@ -171,7 +171,7 @@ fn insert( ctrlc, ) } else { - if let Some(PathMember::Int { val, .. }) = cell_path.members.get(0) { + if let Some(PathMember::Int { val, .. }) = cell_path.members.first() { let mut input = input.into_iter(); let mut pre_elems = vec![]; diff --git a/crates/nu-command/src/filters/reject.rs b/crates/nu-command/src/filters/reject.rs index cef085b5a..8315394da 100644 --- a/crates/nu-command/src/filters/reject.rs +++ b/crates/nu-command/src/filters/reject.rs @@ -221,7 +221,7 @@ fn reject( let mut new_rows = vec![]; for column in cell_paths { let CellPath { ref members } = column; - match members.get(0) { + match members.first() { Some(PathMember::Int { val, span, .. }) => { if members.len() > 1 { return Err(ShellError::GenericError( diff --git a/crates/nu-command/src/filters/select.rs b/crates/nu-command/src/filters/select.rs index 0dd21db9a..9560fe1c6 100644 --- a/crates/nu-command/src/filters/select.rs +++ b/crates/nu-command/src/filters/select.rs @@ -212,7 +212,7 @@ fn select( for column in columns { let CellPath { ref members } = column; - match members.get(0) { + match members.first() { Some(PathMember::Int { val, span, .. }) => { if members.len() > 1 { return Err(ShellError::GenericError( diff --git a/crates/nu-command/src/filters/transpose.rs b/crates/nu-command/src/filters/transpose.rs index 85eea53e8..ccb0a6518 100644 --- a/crates/nu-command/src/filters/transpose.rs +++ b/crates/nu-command/src/filters/transpose.rs @@ -190,7 +190,7 @@ pub fn transpose( if args.header_row { for i in input.iter() { - if let Some(desc) = descs.get(0) { + if let Some(desc) = descs.first() { match &i.get_data_by_key(desc) { Some(x) => { if let Ok(s) = x.as_string() { diff --git a/crates/nu-command/src/filters/update.rs b/crates/nu-command/src/filters/update.rs index 50d767980..5dd4b54d0 100644 --- a/crates/nu-command/src/filters/update.rs +++ b/crates/nu-command/src/filters/update.rs @@ -171,7 +171,7 @@ fn update( )? .set_metadata(mdclone)) } else { - if let Some(PathMember::Int { val, span, .. }) = cell_path.members.get(0) { + if let Some(PathMember::Int { val, span, .. }) = cell_path.members.first() { let mut input = input.into_iter(); let mut pre_elems = vec![]; diff --git a/crates/nu-command/src/filters/upsert.rs b/crates/nu-command/src/filters/upsert.rs index eb1f0d8f3..c4ea332a4 100644 --- a/crates/nu-command/src/filters/upsert.rs +++ b/crates/nu-command/src/filters/upsert.rs @@ -186,7 +186,7 @@ fn upsert( ctrlc, ) } else { - if let Some(PathMember::Int { val, span, .. }) = cell_path.members.get(0) { + if let Some(PathMember::Int { val, span, .. }) = cell_path.members.first() { let mut input = input.into_iter(); let mut pre_elems = vec![]; diff --git a/crates/nu-command/src/formats/from/nuon.rs b/crates/nu-command/src/formats/from/nuon.rs index 34cfd1d65..a8bd4fb99 100644 --- a/crates/nu-command/src/formats/from/nuon.rs +++ b/crates/nu-command/src/formats/from/nuon.rs @@ -59,7 +59,7 @@ impl Command for FromNuon { let mut block = nu_parser::parse(&mut working_set, None, string_input.as_bytes(), false); if let Some(pipeline) = block.pipelines.get(1) { - if let Some(element) = pipeline.elements.get(0) { + if let Some(element) = pipeline.elements.first() { return Err(ShellError::GenericError( "error when loading nuon text".into(), "could not load nuon text".into(), diff --git a/crates/nu-command/src/math/reducers.rs b/crates/nu-command/src/math/reducers.rs index 1f96a778d..86d0f8d7e 100644 --- a/crates/nu-command/src/math/reducers.rs +++ b/crates/nu-command/src/math/reducers.rs @@ -79,7 +79,7 @@ pub fn min(data: Vec, span: Span, head: Span) -> Result, span: Span, head: Span) -> Result { - let initial_value = data.get(0); + let initial_value = data.first(); let mut acc = match initial_value { Some(v) => { @@ -124,7 +124,7 @@ pub fn sum(data: Vec, span: Span, head: Span) -> Result, span: Span, head: Span) -> Result { - let initial_value = data.get(0); + let initial_value = data.first(); let mut acc = match initial_value { Some(v) => { diff --git a/crates/nu-explore/src/nu_common/mod.rs b/crates/nu-explore/src/nu_common/mod.rs index 180851298..290be0490 100644 --- a/crates/nu-explore/src/nu_common/mod.rs +++ b/crates/nu-explore/src/nu_common/mod.rs @@ -15,7 +15,7 @@ pub use nu_protocol::{Config as NuConfig, Span as NuSpan}; pub type NuText = (String, TextStyle); pub type CtrlC = Option>; -pub use command::{is_ignored_command, run_command_with_value, run_nu_command}; +pub use command::run_command_with_value; pub use lscolor::{create_lscolors, lscolorize}; pub use string::{string_width, truncate_str}; pub use table::try_build_table; diff --git a/crates/nu-explore/src/views/record/mod.rs b/crates/nu-explore/src/views/record/mod.rs index e51470241..c2e6bbb27 100644 --- a/crates/nu-explore/src/views/record/mod.rs +++ b/crates/nu-explore/src/views/record/mod.rs @@ -721,7 +721,7 @@ fn build_table_as_record(v: &RecordView) -> Value { let layer = v.get_layer_last(); let cols = layer.columns.to_vec(); - let vals = layer.records.get(0).map_or(Vec::new(), |row| row.clone()); + let vals = layer.records.first().map_or(Vec::new(), |row| row.clone()); Value::record(Record::from_raw_cols_vals(cols, vals), NuSpan::unknown()) } diff --git a/crates/nu-json/README.md b/crates/nu-json/README.md index d2eedf6d2..8ab5ce074 100644 --- a/crates/nu-json/README.md +++ b/crates/nu-json/README.md @@ -63,7 +63,7 @@ fn main() { // Extract the array let array : &mut Vec = sample.get_mut("array").unwrap().as_array_mut().unwrap(); - println!("first: {}", array.get(0).unwrap()); + println!("first: {}", array.first().unwrap()); // Add a value array.push(Value::String("tak".to_string())); diff --git a/crates/nu-lsp/src/lib.rs b/crates/nu-lsp/src/lib.rs index 5eb184b07..f507dce44 100644 --- a/crates/nu-lsp/src/lib.rs +++ b/crates/nu-lsp/src/lib.rs @@ -63,7 +63,7 @@ impl LanguageServer { engine_state: EngineState, ctrlc: Arc, ) -> Result<()> { - let server_capabilities = serde_json::to_value(&ServerCapabilities { + let server_capabilities = serde_json::to_value(ServerCapabilities { text_document_sync: Some(lsp_types::TextDocumentSyncCapability::Kind( TextDocumentSyncKind::INCREMENTAL, )), diff --git a/crates/nu-parser/src/parse_keywords.rs b/crates/nu-parser/src/parse_keywords.rs index 7d8c48801..8303e046f 100644 --- a/crates/nu-parser/src/parse_keywords.rs +++ b/crates/nu-parser/src/parse_keywords.rs @@ -70,13 +70,13 @@ pub const UNALIASABLE_PARSER_KEYWORDS: &[&[u8]] = &[ /// Check whether spans start with a parser keyword that can be aliased pub fn is_unaliasable_parser_keyword(working_set: &StateWorkingSet, spans: &[Span]) -> bool { // try two words - if let (Some(span1), Some(span2)) = (spans.get(0), spans.get(1)) { + if let (Some(span1), Some(span2)) = (spans.first(), spans.get(1)) { let cmd_name = working_set.get_span_contents(span(&[*span1, *span2])); return UNALIASABLE_PARSER_KEYWORDS.contains(&cmd_name); } // try one word - if let Some(span1) = spans.get(0) { + if let Some(span1) = spans.first() { let cmd_name = working_set.get_span_contents(*span1); UNALIASABLE_PARSER_KEYWORDS.contains(&cmd_name) } else { @@ -653,7 +653,7 @@ pub fn parse_extern( let (command_spans, rest_spans) = spans.split_at(split_id); - if let Some(name_span) = rest_spans.get(0) { + if let Some(name_span) = rest_spans.first() { if let Some(err) = detect_params_in_name( working_set, *name_span, @@ -1135,7 +1135,7 @@ pub fn parse_export_in_module( ) -> (Pipeline, Vec) { let spans = &lite_command.parts[..]; - let export_span = if let Some(sp) = spans.get(0) { + let export_span = if let Some(sp) = spans.first() { if working_set.get_span_contents(*sp) != b"export" { working_set.error(ParseError::UnknownState( "expected export statement".into(), @@ -1209,7 +1209,7 @@ pub fn parse_export_in_module( expr: Expr::Call(ref def_call), .. }, - )) = pipeline.elements.get(0) + )) = pipeline.elements.first() { call = def_call.clone(); @@ -1249,7 +1249,7 @@ pub fn parse_export_in_module( expr: Expr::Call(ref def_call), .. }, - )) = pipeline.elements.get(0) + )) = pipeline.elements.first() { call = def_call.clone(); @@ -1310,7 +1310,7 @@ pub fn parse_export_in_module( expr: Expr::Call(ref def_call), .. }, - )) = pipeline.elements.get(0) + )) = pipeline.elements.first() { call = def_call.clone(); @@ -1370,7 +1370,7 @@ pub fn parse_export_in_module( expr: Expr::Call(ref alias_call), .. }, - )) = pipeline.elements.get(0) + )) = pipeline.elements.first() { call = alias_call.clone(); @@ -1429,7 +1429,7 @@ pub fn parse_export_in_module( expr: Expr::Call(ref use_call), .. }, - )) = pipeline.elements.get(0) + )) = pipeline.elements.first() { call = use_call.clone(); @@ -1466,7 +1466,7 @@ pub fn parse_export_in_module( expr: Expr::Call(ref module_call), .. }, - )) = pipeline.elements.get(0) + )) = pipeline.elements.first() { call = module_call.clone(); @@ -1523,7 +1523,7 @@ pub fn parse_export_in_module( expr: Expr::Call(ref def_call), .. }, - )) = pipeline.elements.get(0) + )) = pipeline.elements.first() { call = def_call.clone(); diff --git a/crates/nu-parser/src/parser.rs b/crates/nu-parser/src/parser.rs index 39e5bc052..5fb1e7c9c 100644 --- a/crates/nu-parser/src/parser.rs +++ b/crates/nu-parser/src/parser.rs @@ -1572,10 +1572,10 @@ pub fn parse_brace_expr( let (tokens, _) = lex(bytes, span.start + 1, &[b'\r', b'\n', b'\t'], &[b':'], true); let second_token = tokens - .get(0) + .first() .map(|token| working_set.get_span_contents(token.span)); - let second_token_contents = tokens.get(0).map(|token| token.contents); + let second_token_contents = tokens.first().map(|token| token.contents); let third_token = tokens .get(1) @@ -2666,7 +2666,7 @@ pub fn parse_string_strict(working_set: &mut StateWorkingSet, span: Span) -> Exp } pub fn parse_import_pattern(working_set: &mut StateWorkingSet, spans: &[Span]) -> Expression { - let Some(head_span) = spans.get(0) else { + let Some(head_span) = spans.first() else { working_set.error(ParseError::WrongImportPattern( "needs at least one component of import pattern".to_string(), span(spans), diff --git a/crates/nu-protocol/src/ast/expression.rs b/crates/nu-protocol/src/ast/expression.rs index e20b105dc..1a9038164 100644 --- a/crates/nu-protocol/src/ast/expression.rs +++ b/crates/nu-protocol/src/ast/expression.rs @@ -134,8 +134,8 @@ impl Expression { return true; } - if let Some(pipeline) = block.pipelines.get(0) { - match pipeline.elements.get(0) { + if let Some(pipeline) = block.pipelines.first() { + match pipeline.elements.first() { Some(element) => element.has_in_variable(working_set), None => false, } @@ -150,8 +150,8 @@ impl Expression { return true; } - if let Some(pipeline) = block.pipelines.get(0) { - match pipeline.elements.get(0) { + if let Some(pipeline) = block.pipelines.first() { + match pipeline.elements.first() { Some(element) => element.has_in_variable(working_set), None => false, } @@ -258,8 +258,8 @@ impl Expression { Expr::RowCondition(block_id) | Expr::Subexpression(block_id) => { let block = working_set.get_block(*block_id); - if let Some(pipeline) = block.pipelines.get(0) { - if let Some(expr) = pipeline.elements.get(0) { + if let Some(pipeline) = block.pipelines.first() { + if let Some(expr) = pipeline.elements.first() { expr.has_in_variable(working_set) } else { false @@ -304,8 +304,8 @@ impl Expression { Expr::Block(block_id) => { let block = working_set.get_block(*block_id); - let new_expr = if let Some(pipeline) = block.pipelines.get(0) { - if let Some(element) = pipeline.elements.get(0) { + let new_expr = if let Some(pipeline) = block.pipelines.first() { + if let Some(element) = pipeline.elements.first() { let mut new_element = element.clone(); new_element.replace_in_variable(working_set, new_var_id); Some(new_element) @@ -335,8 +335,8 @@ impl Expression { Expr::Closure(block_id) => { let block = working_set.get_block(*block_id); - let new_element = if let Some(pipeline) = block.pipelines.get(0) { - if let Some(element) = pipeline.elements.get(0) { + let new_element = if let Some(pipeline) = block.pipelines.first() { + if let Some(element) = pipeline.elements.first() { let mut new_element = element.clone(); new_element.replace_in_variable(working_set, new_var_id); Some(new_element) @@ -433,8 +433,8 @@ impl Expression { Expr::RowCondition(block_id) | Expr::Subexpression(block_id) => { let block = working_set.get_block(*block_id); - let new_element = if let Some(pipeline) = block.pipelines.get(0) { - if let Some(element) = pipeline.elements.get(0) { + let new_element = if let Some(pipeline) = block.pipelines.first() { + if let Some(element) = pipeline.elements.first() { let mut new_element = element.clone(); new_element.replace_in_variable(working_set, new_var_id); Some(new_element) diff --git a/crates/nu-protocol/src/engine/engine_state.rs b/crates/nu-protocol/src/engine/engine_state.rs index 646b842f9..d7b29f2d4 100644 --- a/crates/nu-protocol/src/engine/engine_state.rs +++ b/crates/nu-protocol/src/engine/engine_state.rs @@ -753,8 +753,7 @@ impl EngineState { decls_map.extend(new_decls); } - let mut decls: Vec<(Vec, DeclId)> = - decls_map.into_iter().map(|(v, k)| (v, k)).collect(); + let mut decls: Vec<(Vec, DeclId)> = decls_map.into_iter().collect(); decls.sort_by(|a, b| a.0.cmp(&b.0)); decls.into_iter() diff --git a/src/command.rs b/src/command.rs index 4edf4376f..10d105a2b 100644 --- a/src/command.rs +++ b/src/command.rs @@ -81,14 +81,14 @@ pub(crate) fn parse_commandline_args( let mut stack = Stack::new(); // We should have a successful parse now - if let Some(pipeline) = block.pipelines.get(0) { + if let Some(pipeline) = block.pipelines.first() { if let Some(PipelineElement::Expression( _, Expression { expr: Expr::Call(call), .. }, - )) = pipeline.elements.get(0) + )) = pipeline.elements.first() { let redirect_stdin = call.get_named_arg("stdin"); let login_shell = call.get_named_arg("login");