From f41283c8290cded6abf7f1e01e2c7e057c4814f4 Mon Sep 17 00:00:00 2001 From: Dan Davison Date: Mon, 4 Dec 2023 10:30:08 -0500 Subject: [PATCH] Fix linter violations (#651) --- tests/integ_tests/workflow_tests/cancel_external.rs | 2 +- tests/integ_tests/workflow_tests/cancel_wf.rs | 2 +- tests/integ_tests/workflow_tests/child_workflows.rs | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/integ_tests/workflow_tests/cancel_external.rs b/tests/integ_tests/workflow_tests/cancel_external.rs index a28f403de..c70909f9e 100644 --- a/tests/integ_tests/workflow_tests/cancel_external.rs +++ b/tests/integ_tests/workflow_tests/cancel_external.rs @@ -25,7 +25,7 @@ async fn cancel_sender(ctx: WfContext) -> WorkflowResult<()> { Ok(().into()) } -async fn cancel_receiver(mut ctx: WfContext) -> WorkflowResult<()> { +async fn cancel_receiver(ctx: WfContext) -> WorkflowResult<()> { ctx.cancelled().await; Ok(().into()) } diff --git a/tests/integ_tests/workflow_tests/cancel_wf.rs b/tests/integ_tests/workflow_tests/cancel_wf.rs index a29eb2bf8..b3f874979 100644 --- a/tests/integ_tests/workflow_tests/cancel_wf.rs +++ b/tests/integ_tests/workflow_tests/cancel_wf.rs @@ -4,7 +4,7 @@ use temporal_sdk::{WfContext, WfExitValue, WorkflowResult}; use temporal_sdk_core_protos::temporal::api::enums::v1::WorkflowExecutionStatus; use temporal_sdk_core_test_utils::CoreWfStarter; -async fn cancelled_wf(mut ctx: WfContext) -> WorkflowResult<()> { +async fn cancelled_wf(ctx: WfContext) -> WorkflowResult<()> { let cancelled = tokio::select! { _ = ctx.timer(Duration::from_secs(500)) => false, _ = ctx.cancelled() => true diff --git a/tests/integ_tests/workflow_tests/child_workflows.rs b/tests/integ_tests/workflow_tests/child_workflows.rs index 3e50b1352..6c716170a 100644 --- a/tests/integ_tests/workflow_tests/child_workflows.rs +++ b/tests/integ_tests/workflow_tests/child_workflows.rs @@ -64,7 +64,7 @@ async fn abandoned_child_bug_repro() { worker.register_wf( PARENT_WF_TYPE.to_string(), - move |mut ctx: WfContext| async move { + move |ctx: WfContext| async move { let child = ctx.child_workflow(ChildWorkflowOptions { workflow_id: "abandoned-child".to_owned(), workflow_type: CHILD_WF_TYPE.to_owned(), @@ -89,7 +89,7 @@ async fn abandoned_child_bug_repro() { Ok(().into()) }, ); - worker.register_wf(CHILD_WF_TYPE.to_string(), |mut ctx: WfContext| async move { + worker.register_wf(CHILD_WF_TYPE.to_string(), |ctx: WfContext| async move { ctx.cancelled().await; Ok(WfExitValue::<()>::Cancelled) }); @@ -135,7 +135,7 @@ async fn abandoned_child_resolves_post_cancel() { worker.register_wf( PARENT_WF_TYPE.to_string(), - move |mut ctx: WfContext| async move { + move |ctx: WfContext| async move { let child = ctx.child_workflow(ChildWorkflowOptions { workflow_id: "abandoned-child-resolve-post-cancel".to_owned(), workflow_type: CHILD_WF_TYPE.to_owned(),