Skip to content

[Feature]: Deprecate FutureExt trait for having a far too general blanket implementationΒ #3291

@Kile-Asmussen

Description

@Kile-Asmussen

Related Problems?

The opentelemetry::context::future_ext::FutureExt extension trait has a blanket implementation that is overly general:

impl<T: Sized> FutureExt for T {}

This is a code smell.

This blanket-impl was likely made because WithContext implements Future, Stream and Sink, depending on what type is wrapped, and while it works, it also means that i32 implements FutureExt.

Describe the solution you'd like:

Introduce three separate traits providing a with_context extension method for Future, Stream, and Sink separately.

Considered Alternatives

Don't import FutureExt and just make my own extension trait.

Additional Context

In a future release, after an appropriate deprecation period, the FutureExt trait can be entirely removed.

Tip

React with πŸ‘ to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions