A suggestion was made to simplify the generic constraints in the dlq_error_scenarios function in tests/push_policies.rs around lines 156-157.
The current approach using BoxFuture adds complexity and explicit lifetime management. The suggestion is to replace the BoxFuture return type with async closures using higher-ranked trait bounds (for<'a>) and returning an impl Future instead.
This would simplify the code by leveraging async closures and removing the need for boxing and explicit lifetimes.
References:
A suggestion was made to simplify the generic constraints in the
dlq_error_scenariosfunction intests/push_policies.rsaround lines 156-157.The current approach using
BoxFutureadds complexity and explicit lifetime management. The suggestion is to replace theBoxFuturereturn type with async closures using higher-ranked trait bounds (for<'a>) and returning an impl Future instead.This would simplify the code by leveraging async closures and removing the need for boxing and explicit lifetimes.
References: