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

Add From<T> for Response<T> #1064

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

amrhassan
Copy link
Contributor

Hello,

Motivation

I've noticed that there's no From<T> implementation for Response<T> and thought it was worth having for the times when writing t.into() is snappier than Response::new(t).

Solution

I've added the trait impl.

@LucioFranco
Copy link
Member

I am trying to remember why we didn't include this. I know for requests we have IntoRequest. But I can't come up with why we shouldn't include this. Would love to hear from others @neoeinstein @davidpdrsn

Copy link
Member

@davidpdrsn davidpdrsn left a comment

Choose a reason for hiding this comment

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

I think ergonomics-wise it doesn't make much difference but don't think it could hurt to add.

@LucioFranco
Copy link
Member

This is going to have to wait for the next breaking change release.

@tottoto tottoto requested a review from LucioFranco January 25, 2025 00:02
@tottoto tottoto added this to the 0.13 milestone Jan 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants