Fix clippy warnings (#3997)

This commit is contained in:
JT 2021-09-10 13:13:11 +12:00 committed by GitHub
parent 55eafadf02
commit 0fa0c25fb3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 7 deletions

View File

@ -69,7 +69,7 @@ impl WholeStreamCommand for Each {
} }
pub fn process_row( pub fn process_row(
captured_block: Arc<Box<CapturedBlock>>, captured_block: Arc<CapturedBlock>,
context: Arc<EvaluationContext>, context: Arc<EvaluationContext>,
input: Value, input: Value,
external_redirection: ExternalRedirection, external_redirection: ExternalRedirection,
@ -121,7 +121,7 @@ fn each(args: CommandArgs) -> Result<OutputStream, ShellError> {
let block: CapturedBlock = args.req(0)?; let block: CapturedBlock = args.req(0)?;
let numbered: bool = args.has_flag("numbered"); let numbered: bool = args.has_flag("numbered");
let block = Arc::new(Box::new(block)); let block = Arc::new(block);
if numbered { if numbered {
Ok(args Ok(args

View File

@ -43,7 +43,7 @@ impl WholeStreamCommand for EachGroup {
let group_size: Tagged<usize> = args.req(0)?; let group_size: Tagged<usize> = args.req(0)?;
let block: CapturedBlock = args.req(1)?; let block: CapturedBlock = args.req(1)?;
let block = Arc::new(Box::new(block)); let block = Arc::new(block);
let each_group_iterator = EachGroupIterator { let each_group_iterator = EachGroupIterator {
block, block,
@ -58,7 +58,7 @@ impl WholeStreamCommand for EachGroup {
} }
struct EachGroupIterator { struct EachGroupIterator {
block: Arc<Box<CapturedBlock>>, block: Arc<CapturedBlock>,
context: Arc<EvaluationContext>, context: Arc<EvaluationContext>,
group_size: usize, group_size: usize,
input: InputStream, input: InputStream,
@ -96,7 +96,7 @@ impl Iterator for EachGroupIterator {
pub(crate) fn run_block_on_vec( pub(crate) fn run_block_on_vec(
input: Vec<Value>, input: Vec<Value>,
block: Arc<Box<CapturedBlock>>, block: Arc<CapturedBlock>,
context: Arc<EvaluationContext>, context: Arc<EvaluationContext>,
external_redirection: ExternalRedirection, external_redirection: ExternalRedirection,
) -> OutputStream { ) -> OutputStream {

View File

@ -49,7 +49,7 @@ impl WholeStreamCommand for EachWindow {
let block: CapturedBlock = args.req(1)?; let block: CapturedBlock = args.req(1)?;
let stride: Option<Tagged<usize>> = args.get_flag("stride")?; let stride: Option<Tagged<usize>> = args.get_flag("stride")?;
let block = Arc::new(Box::new(block)); let block = Arc::new(block);
let mut window: Vec<_> = args let mut window: Vec<_> = args
.input .input

View File

@ -137,7 +137,7 @@ pub fn group_by(args: CommandArgs) -> Result<OutputStream, ShellError> {
value: UntaggedValue::Block(block_given), value: UntaggedValue::Block(block_given),
.. ..
}) => { }) => {
let block = Arc::new(block_given); let block = Arc::new(*block_given);
let error_key = "error"; let error_key = "error";
for value in &values { for value in &values {