Skip to content

Implement Default for MakeRequestUuid#335

Merged
davidpdrsn merged 2 commits intotower-rs:masterfrom
tottoto:makerequestuuid-default
Mar 11, 2023
Merged

Implement Default for MakeRequestUuid#335
davidpdrsn merged 2 commits intotower-rs:masterfrom
tottoto:makerequestuuid-default

Conversation

@tottoto
Copy link
Copy Markdown
Contributor

@tottoto tottoto commented Mar 11, 2023

Motivation

Hides the details of MakeRequestUuid in instantiating it.

Solution

Implements Default for MakeRequestUuid.

async fn uuid() {
let svc = ServiceBuilder::new()
.set_x_request_id(MakeRequestUuid)
.set_x_request_id(MakeRequestUuid::default())
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm okay with deriving default but don't think we need to use it here. It's just more typing.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@davidpdrsn davidpdrsn merged commit 0d70221 into tower-rs:master Mar 11, 2023
@tottoto tottoto deleted the makerequestuuid-default branch March 11, 2023 16:08
gezihuzi pushed a commit to gezihuzi/tower-http that referenced this pull request Jul 19, 2023
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.

2 participants