fixed awc thing
This commit is contained in:
@ -74,14 +74,14 @@ pub fn derive_http_get_request(input: TokenStream) -> TokenStream {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let response = actix_web::rt::System::new()
|
let response = rt::System::new()
|
||||||
.block_on(async {
|
.block_on(async {
|
||||||
request.send()
|
request.send()
|
||||||
.await
|
.await
|
||||||
.map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e.to_string()))
|
.map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e.to_string()))
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
let body_bytes = actix_web::rt::System::new()
|
let body_bytes = rt::System::new()
|
||||||
.block_on(async {
|
.block_on(async {
|
||||||
response.body()
|
response.body()
|
||||||
.await
|
.await
|
||||||
@ -148,7 +148,7 @@ pub fn http_response(_attr: TokenStream, item: TokenStream) -> TokenStream {
|
|||||||
where
|
where
|
||||||
Self: serde::de::DeserializeOwned + Sized + Send,
|
Self: serde::de::DeserializeOwned + Sized + Send,
|
||||||
{
|
{
|
||||||
async fn receive(mut resp: actix_web::ClientResponse) -> Result<Self, Box<dyn std::error::Error>> {
|
async fn receive(mut resp: awc::ClientResponse) -> Result<Self, Box<dyn std::error::Error>> {
|
||||||
let parsed = resp.json::<Self>().await?;
|
let parsed = resp.json::<Self>().await?;
|
||||||
Ok(parsed)
|
Ok(parsed)
|
||||||
}
|
}
|
||||||
@ -178,7 +178,7 @@ pub fn http_response(_attr: TokenStream, item: TokenStream) -> TokenStream {
|
|||||||
where
|
where
|
||||||
Self: Sized + Send,
|
Self: Sized + Send,
|
||||||
{
|
{
|
||||||
async fn receive(mut resp: actix_web::ClientResponse) -> Result<Self, Box<dyn std::error::Error>> {
|
async fn receive(mut resp: awc::ClientResponse) -> Result<Self, Box<dyn std::error::Error>> {
|
||||||
let body = resp.body().await?; // Bytes, sized!
|
let body = resp.body().await?; // Bytes, sized!
|
||||||
#(#variant_arms)*
|
#(#variant_arms)*
|
||||||
Err(Box::new(std::io::Error::new(
|
Err(Box::new(std::io::Error::new(
|
||||||
|
Reference in New Issue
Block a user