@@ -217,12 +217,12 @@ impl WorkerConfigBuilder {
217217 b. validate ( ) ?
218218 }
219219
220- if let Some ( Some ( ref x) ) = self . max_worker_activities_per_second {
221- if !x. is_normal ( ) || x. is_sign_negative ( ) {
222- return Err (
223- "`max_worker_activities_per_second` must be positive and nonzero" . to_owned ( ) ,
224- ) ;
225- }
220+ if let Some ( Some ( ref x) ) = self . max_worker_activities_per_second
221+ && ( !x. is_normal ( ) || x. is_sign_negative ( ) )
222+ {
223+ return Err (
224+ "`max_worker_activities_per_second` must be positive and nonzero" . to_owned ( ) ,
225+ ) ;
226226 }
227227
228228 if matches ! ( self . max_outstanding_workflow_tasks. as_ref( ) , Some ( Some ( v) ) if * v == 0 ) {
@@ -238,25 +238,25 @@ impl WorkerConfigBuilder {
238238 return Err ( "`max_outstanding_nexus_tasks` must be > 0" . to_owned ( ) ) ;
239239 }
240240
241- if let Some ( cache) = self . max_cached_workflows . as_ref ( ) {
242- if * cache > 0 {
243- if let Some ( Some ( max_wft) ) = self . max_outstanding_workflow_tasks . as_ref ( ) {
244- if * max_wft < 2 {
245- return Err (
246- "`max_cached_workflows` > 0 requires `max_outstanding_workflow_tasks` >= 2"
247- . to_owned ( ) ,
248- ) ;
249- }
250- }
251- if let Some ( b) = self . workflow_task_poller_behavior . as_ref ( ) {
252- if matches ! ( b, PollerBehavior :: SimpleMaximum ( u) if * u < 2 ) {
253- return Err (
241+ if let Some ( cache) = self . max_cached_workflows . as_ref ( )
242+ && * cache > 0
243+ {
244+ if let Some ( Some ( max_wft) ) = self . max_outstanding_workflow_tasks . as_ref ( )
245+ && * max_wft < 2
246+ {
247+ return Err (
248+ "`max_cached_workflows` > 0 requires `max_outstanding_workflow_tasks` >= 2"
249+ . to_owned ( ) ,
250+ ) ;
251+ }
252+ if let Some ( b) = self . workflow_task_poller_behavior . as_ref ( ) {
253+ if matches ! ( b, PollerBehavior :: SimpleMaximum ( u) if * u < 2 ) {
254+ return Err (
254255 "`max_cached_workflows` > 0 requires `workflow_task_poller_behavior` to be at least 2"
255256 . to_owned ( ) ,
256257 ) ;
257- }
258- b. validate ( ) ?
259258 }
259+ b. validate ( ) ?
260260 }
261261 }
262262
0 commit comments