Skip to content

Commit c9c17c7

Browse files
amrhassantottoto
andauthored
Add From<T> for Response<T> (#1064)
Co-authored-by: tottoto <tottotodev@gmail.com>
1 parent 86815d8 commit c9c17c7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tonic/src/response.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,12 @@ impl<T> Response<T> {
127127
}
128128
}
129129

130+
impl<T> From<T> for Response<T> {
131+
fn from(inner: T) -> Self {
132+
Response::new(inner)
133+
}
134+
}
135+
130136
#[cfg(test)]
131137
mod tests {
132138
use super::*;

0 commit comments

Comments
 (0)