Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: tower should be an optional dependency #79

Merged
merged 3 commits into from
Dec 16, 2023

Conversation

sigoden
Copy link
Contributor

@sigoden sigoden commented Dec 16, 2023

The tower/tower-service is only used in the client/client-legacy feature. If one only needs server/server-auto feature, there is no need to include them.

Testing in sigoden/dufs#321, with this pr, there is a reduction of 0.3 M in the stripped release binary.

@tottoto
Copy link
Contributor

tottoto commented Dec 16, 2023

Sounds reasonable to me.

Copy link
Member

@seanmonstar seanmonstar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Me too, thanks!

@seanmonstar
Copy link
Member

Ah, looks like there's some cfg adjustments needed.

@davidpdrsn
Copy link
Member

Is this a breaking change?

@tottoto
Copy link
Contributor

tottoto commented Dec 16, 2023

As TowerToHyperService has not been released, I do not think this is a breaking change.

@sigoden
Copy link
Contributor Author

sigoden commented Dec 16, 2023

The service features cannot be used independently.

impl<S, R> hyper::service::Service<R> for TowerToHyperService<S>

#[cfg(all(
    any(feature = "http1", feature = "http2"),
    any(feature = "server", feature = "client")
))]
pub use self::service::Service;

https://github.com/hyperium/hyper/blob/d9c5d3b9b3921e05040ef50d4aca080f563aac36/src/service/mod.rs#L30-L33

@sigoden
Copy link
Contributor Author

sigoden commented Dec 16, 2023

As TowerToHyperService has not been released, I do not think this is a breaking change.

As @tottoto said, this is not a break change. @davidpdrsn

@seanmonstar seanmonstar merged commit 61724d1 into hyperium:master Dec 16, 2023
15 checks passed
@sigoden sigoden deleted the feat-deps branch December 16, 2023 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants