Skip to content

Commit a22a9f1

Browse files
authored
initial pr feedback
1 parent b81c09a commit a22a9f1

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

sdk/typespec/typespec_client_core/src/http/format.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
14
use serde::de::DeserializeOwned;
25

36
use crate::http::response::ResponseBody;
@@ -27,7 +30,7 @@ pub trait DeserializeWith<F: Format>: Sized {
2730
/// Implements [`DeserializeWith<T>`] for [`ResponseBody`], by simply returning the body stream as is.
2831
#[cfg_attr(target_arch = "wasm32", async_trait::async_trait(?Send))]
2932
#[cfg_attr(not(target_arch = "wasm32"), async_trait::async_trait)]
30-
impl<T: Format> DeserializeWith<T> for ResponseBody {
33+
impl<F: Format> DeserializeWith<F> for ResponseBody {
3134
async fn deserialize_with(body: ResponseBody) -> typespec::Result<Self> {
3235
Ok(body)
3336
}

sdk/typespec/typespec_client_core/src/http/response.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub struct Response<T = ResponseBody, F = DefaultFormat> {
2828
status: StatusCode,
2929
headers: Headers,
3030
body: ResponseBody,
31-
phantom: PhantomData<(T, F)>,
31+
_phantom: PhantomData<(T, F)>,
3232
}
3333

3434
impl<F> Response<ResponseBody, F> {
@@ -40,7 +40,7 @@ impl<F> Response<ResponseBody, F> {
4040
status: self.status,
4141
headers: self.headers,
4242
body: self.body,
43-
phantom: PhantomData,
43+
_phantom: PhantomData,
4444
}
4545
}
4646
}
@@ -52,7 +52,7 @@ impl<T, F> Response<T, F> {
5252
status,
5353
headers,
5454
body: ResponseBody::new(stream),
55-
phantom: PhantomData,
55+
_phantom: PhantomData,
5656
}
5757
}
5858

@@ -62,7 +62,7 @@ impl<T, F> Response<T, F> {
6262
status,
6363
headers,
6464
body: ResponseBody::from_bytes(bytes),
65-
phantom: PhantomData,
65+
_phantom: PhantomData,
6666
}
6767
}
6868

@@ -97,7 +97,7 @@ impl<T, F> Response<T, F> {
9797
status: self.status,
9898
headers: self.headers,
9999
body: self.body,
100-
phantom: PhantomData,
100+
_phantom: PhantomData,
101101
}
102102
}
103103
}

0 commit comments

Comments
 (0)