-
-
Notifications
You must be signed in to change notification settings - Fork 18
feat(client): Simplify client configuration #110
Conversation
WalkthroughThe recent changes to the HTTP client configuration streamline the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant ClientBuilder
participant Config
participant HyperBuilder
User->>ClientBuilder: Create a new ClientBuilder
ClientBuilder->>HyperBuilder: Initialize builder
ClientBuilder->>Config: Set options on builder
Config->>HyperBuilder: Configure HTTP settings
ClientBuilder->>User: Return configured client
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- src/async_impl/client.rs (21 hunks)
Additional comments not posted (10)
src/async_impl/client.rs (10)
97-97
: Addition ofbuilder
field is well-structured.The introduction of the
builder
field centralizes configuration using thehyper
library's builder pattern, enhancing maintainability and clarity.
147-147
: Initialization ofbuilder
is appropriate.The
builder
field is correctly initialized withhyper::Client::builder()
, setting up the builder pattern for configuration.
236-246
: Consolidation of configuration logic inbuild
method is effective.The use of
builder
in thebuild
method simplifies the construction of the HTTP client by consolidating configuration logic.
264-264
: Usage ofbuilder
inimpersonate
is consistent with the builder pattern.The
builder
is used to set HTTP/2 agent profile, ensuring centralized management of HTTP/2 settings.
Line range hint
699-737
: Centralization of HTTP/1 settings improves maintainability.Methods for HTTP/1 settings now use
builder
, enhancing consistency and maintainability.
Line range hint
770-878
: Centralization of HTTP/2 settings aligns with simplification goals.Methods for HTTP/2 settings now use
builder
, which centralizes configuration and simplifies client setup.
1565-1565
: Inclusion ofbuilder
infmt_fields
is beneficial for debugging.Including the
builder
field infmt_fields
enhances the visibility of its state during debugging.
97-97
: Removal of individual HTTP settings reduces complexity.The removal of individual HTTP/1 and HTTP/2 configuration fields reduces complexity and potential redundancy, as these are now encapsulated by the
builder
.Also applies to: 147-147, 236-246, 264-264, 699-737, 770-878, 1565-1565
Line range hint
699-878
: Streamlined configuration process inClientBuilder
methods.The methods now directly modify the
builder
, which streamlines the configuration process and aligns with the builder pattern.
97-97
: Overall restructuring enhances maintainability and clarity.The restructuring centralizes configuration using the builder pattern, improving maintainability and aligning with modern Rust practices.
Also applies to: 147-147, 236-246, 264-264, 699-737, 770-878, 1565-1565
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- src/tls/mod.rs (1 hunks)
Additional comments not posted (1)
src/tls/mod.rs (1)
3-5
: Documentation update approved.The updated documentation clearly states that BoringSSL is used for TLS by default, which aligns with the changes in the TLS implementation.
Summary by CodeRabbit
New Features
Bug Fixes
Refactor
Documentation