From 25a5e8d8e817df5ccbeea8f4e4f1b93ff5cc7082 Mon Sep 17 00:00:00 2001 From: Piepmatz Date: Wed, 2 Jul 2025 16:46:53 +0200 Subject: [PATCH] Allow enabling deprecated experimental options (#16096) # Description This PR changes the behavior of #16028 to allow enabling experimental options even if they are marked as deprecated. # Tests + Formatting - :green_circle: `toolkit fmt` - :green_circle: `toolkit clippy` - :green_circle: `toolkit test` - :green_circle: `toolkit test stdlib` --- crates/nu-experimental/src/parse.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/crates/nu-experimental/src/parse.rs b/crates/nu-experimental/src/parse.rs index 679135345c..79bd146c49 100644 --- a/crates/nu-experimental/src/parse.rs +++ b/crates/nu-experimental/src/parse.rs @@ -39,7 +39,7 @@ pub enum ParseWarning { /// - a context value, which is returned with any warning /// /// This way you don't need to manually track which input caused which warning. -pub fn parse_iter<'i, Ctx>( +pub fn parse_iter<'i, Ctx: Clone>( iter: impl Iterator, Option>, Ctx)>, ) -> Vec<(ParseWarning, Ctx)> { let mut warnings = Vec::new(); @@ -51,12 +51,10 @@ pub fn parse_iter<'i, Ctx>( match option.status() { Status::DeprecatedDiscard => { - warnings.push((ParseWarning::DeprecatedDiscard(option), ctx)); - continue; + warnings.push((ParseWarning::DeprecatedDiscard(option), ctx.clone())); } Status::DeprecatedDefault => { - warnings.push((ParseWarning::DeprecatedDefault(option), ctx)); - continue; + warnings.push((ParseWarning::DeprecatedDefault(option), ctx.clone())); } _ => {} }