fixed to use awc
This commit is contained in:
@ -20,8 +20,8 @@ pub fn http_response(_attr: TokenStream, item: TokenStream) -> TokenStream {
|
|||||||
where
|
where
|
||||||
Self: serde::de::DeserializeOwned + Sized,
|
Self: serde::de::DeserializeOwned + Sized,
|
||||||
{
|
{
|
||||||
fn receive(resp: actix_web::ClientResponse) -> Result<Self, Box<dyn std::error::Error>> {
|
fn receive(resp: awc::ClientResponse) -> Result<Self, Box<dyn std::error::Error>> {
|
||||||
let parsed = actix_web::rt::System::new()
|
let parsed = awc::rt::System::new()
|
||||||
.block_on(async {
|
.block_on(async {
|
||||||
resp.json::<Self>().await
|
resp.json::<Self>().await
|
||||||
})
|
})
|
||||||
@ -50,7 +50,7 @@ pub fn http_response(_attr: TokenStream, item: TokenStream) -> TokenStream {
|
|||||||
|
|
||||||
quote! {
|
quote! {
|
||||||
impl Responsable for #name {
|
impl Responsable for #name {
|
||||||
fn receive(resp: actix_web::ClientResponse) -> Result<Self, Box<dyn std::error::Error>> {
|
fn receive(resp: awc::ClientResponse) -> Result<Self, Box<dyn std::error::Error>> {
|
||||||
#(#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