tonic icon indicating copy to clipboard operation
tonic copied to clipboard

Add From<T> for Response<T>

Open amrhassan opened this issue 3 years ago • 2 comments

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.

amrhassan avatar Aug 19 '22 19:08 amrhassan

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

LucioFranco avatar Aug 22 '22 15:08 LucioFranco

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

LucioFranco avatar Sep 28 '22 14:09 LucioFranco