Skip to content

Commit 389337b

Browse files
authored
sdk: remove unnecessary Debug constraints (#684)
* Resolve implied bounds issue for clippy 1.76 * sdk: remove Debug constraint on WfExitValue argument * sdk: remove Debug constraint on ActExtValue argument
1 parent c097a3d commit 389337b

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

core/src/telemetry/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,9 +271,7 @@ impl TemporalitySelector for ConstantTemporality {
271271
self.0
272272
}
273273
}
274-
fn metric_temporality_to_selector(
275-
t: MetricTemporality,
276-
) -> impl TemporalitySelector + Send + Sync + Clone {
274+
fn metric_temporality_to_selector(t: MetricTemporality) -> impl TemporalitySelector + Clone {
277275
match t {
278276
MetricTemporality::Cumulative => ConstantTemporality(Temporality::Cumulative),
279277
MetricTemporality::Delta => ConstantTemporality(Temporality::Delta),

sdk/src/lib.rs

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ impl<F, Fut, O> From<F> for WorkflowFunction
711711
where
712712
F: Fn(WfContext) -> Fut + Send + Sync + 'static,
713713
Fut: Future<Output = Result<WfExitValue<O>, anyhow::Error>> + Send + 'static,
714-
O: Serialize + Debug,
714+
O: Serialize,
715715
{
716716
fn from(wf_func: F) -> Self {
717717
Self::new(wf_func)
@@ -724,7 +724,7 @@ impl WorkflowFunction {
724724
where
725725
F: Fn(WfContext) -> Fut + Send + Sync + 'static,
726726
Fut: Future<Output = Result<WfExitValue<O>, anyhow::Error>> + Send + 'static,
727-
O: Serialize + Debug,
727+
O: Serialize,
728728
{
729729
Self {
730730
wf_func: Box::new(move |ctx: WfContext| {
@@ -750,7 +750,7 @@ pub type WorkflowResult<T> = Result<WfExitValue<T>, anyhow::Error>;
750750

751751
/// Workflow functions may return these values when exiting
752752
#[derive(Debug, derive_more::From)]
753-
pub enum WfExitValue<T: Debug> {
753+
pub enum WfExitValue<T> {
754754
/// Continue the workflow as a new execution
755755
#[from(ignore)]
756756
ContinueAsNew(Box<ContinueAsNewWorkflowExecution>),
@@ -764,23 +764,27 @@ pub enum WfExitValue<T: Debug> {
764764
Normal(T),
765765
}
766766

767-
impl<T: Debug> WfExitValue<T> {
767+
impl<T> WfExitValue<T> {
768768
/// Construct a [WfExitValue::ContinueAsNew] variant (handles boxing)
769769
pub fn continue_as_new(can: ContinueAsNewWorkflowExecution) -> Self {
770770
Self::ContinueAsNew(Box::new(can))
771771
}
772772
}
773773

774774
/// Activity functions may return these values when exiting
775-
#[derive(derive_more::From)]
776-
pub enum ActExitValue<T: Debug> {
775+
pub enum ActExitValue<T> {
777776
/// Completion requires an asynchronous callback
778-
#[from(ignore)]
779777
WillCompleteAsync,
780778
/// Finish with a result
781779
Normal(T),
782780
}
783781

782+
impl<T: AsJsonPayloadExt> From<T> for ActExitValue<T> {
783+
fn from(t: T) -> Self {
784+
Self::Normal(t)
785+
}
786+
}
787+
784788
type BoxActFn = Arc<
785789
dyn Fn(ActContext, Payload) -> BoxFuture<'static, Result<ActExitValue<Payload>, anyhow::Error>>
786790
+ Send
@@ -835,7 +839,7 @@ where
835839
A: FromJsonPayloadExt + Send,
836840
Rf: Future<Output = Result<R, anyhow::Error>> + Send + 'static,
837841
R: Into<ActExitValue<O>>,
838-
O: AsJsonPayloadExt + Debug,
842+
O: AsJsonPayloadExt,
839843
{
840844
fn into_activity_fn(self) -> BoxActFn {
841845
let wrapper = move |ctx: ActContext, input: Payload| {

0 commit comments

Comments
 (0)