Skip to content

feat: tower should be an optional dependency#79

Merged
seanmonstar merged 3 commits into
hyperium:masterfrom
sigoden:feat-deps
Dec 16, 2023
Merged

feat: tower should be an optional dependency#79
seanmonstar merged 3 commits into
hyperium:masterfrom
sigoden:feat-deps

Conversation

@sigoden
Copy link
Copy Markdown
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
Copy Markdown
Contributor

tottoto commented Dec 16, 2023

Sounds reasonable to me.

Copy link
Copy Markdown
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
Copy Markdown
Member

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

@davidpdrsn
Copy link
Copy Markdown
Member

Is this a breaking change?

@tottoto
Copy link
Copy Markdown
Contributor

tottoto commented Dec 16, 2023

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

@sigoden
Copy link
Copy Markdown
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
Copy Markdown
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

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