Remove deprecated where -b parameter (#7927)

This commit is contained in:
Jakub Žádník 2023-01-31 21:05:28 +02:00 committed by GitHub
parent ad14b763f9
commit 517ef7cde7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,8 +2,8 @@ use nu_engine::{eval_block, CallExt};
use nu_protocol::ast::Call;
use nu_protocol::engine::{Closure, Command, EngineState, Stack};
use nu_protocol::{
Category, Example, IntoInterruptiblePipelineData, IntoPipelineData, PipelineData, ShellError,
Signature, Span, Spanned, SyntaxShape, Type, Value,
Category, Example, IntoInterruptiblePipelineData, IntoPipelineData, PipelineData, Signature,
Span, SyntaxShape, Type, Value,
};
#[derive(Clone)]
@ -38,13 +38,6 @@ not supported."#
SyntaxShape::RowCondition,
"Filter condition",
)
// TODO: Remove this flag after 0.73.0 release
.named(
"closure",
SyntaxShape::Closure(Some(vec![SyntaxShape::Any, SyntaxShape::Int])),
"use with a closure instead (deprecated: use 'filter' command instead)",
Some('b'),
)
.category(Category::Filters)
}
@ -59,14 +52,6 @@ not supported."#
call: &Call,
input: PipelineData,
) -> Result<nu_protocol::PipelineData, nu_protocol::ShellError> {
if let Some(closure) = call.get_flag::<Spanned<Closure>>(engine_state, stack, "closure")? {
return Err(ShellError::DeprecatedParameter(
"-b, --closure".to_string(),
"filter command".to_string(),
closure.span,
));
}
let closure: Closure = call.req(engine_state, stack, 0)?;
let span = call.head;