From 789f09fa679b4ecfbf4ffa890abee33d7c03605c Mon Sep 17 00:00:00 2001 From: Vincent Herlemont Date: Sun, 29 Oct 2023 09:39:40 +0100 Subject: [PATCH] fix: unknown result on macro --- .../native_model/native_model_macro/src/method/decode_body.rs | 2 +- .../native_model/native_model_macro/src/method/encode_body.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/native_model/native_model_macro/src/method/decode_body.rs b/libraries/native_model/native_model_macro/src/method/decode_body.rs index 3ff228da..e229651c 100644 --- a/libraries/native_model/native_model_macro/src/method/decode_body.rs +++ b/libraries/native_model/native_model_macro/src/method/decode_body.rs @@ -6,7 +6,7 @@ pub(crate) fn generate_native_model_decode_body(attrs: &ModelAttributes) -> Toke let id = attrs.id.clone().expect("`id` is required"); let with = attrs.with.clone().expect("`with` is required"); let gen = quote! { - fn native_model_decode_body(data: Vec, id: u32) -> Result { + fn native_model_decode_body(data: Vec, id: u32) -> std::result::Result { println!("id: {}, {}", id, #id); if id != #id { return Err(native_model::DecodeBodyError::MismatchedModelId); diff --git a/libraries/native_model/native_model_macro/src/method/encode_body.rs b/libraries/native_model/native_model_macro/src/method/encode_body.rs index f756063e..36571369 100644 --- a/libraries/native_model/native_model_macro/src/method/encode_body.rs +++ b/libraries/native_model/native_model_macro/src/method/encode_body.rs @@ -5,7 +5,7 @@ use quote::quote; pub(crate) fn generate_native_model_encode_body(attrs: &ModelAttributes) -> TokenStream { let with = attrs.with.clone().expect("`with` is required"); let gen = quote! { - fn native_model_encode_body(&self) -> Result, native_model::EncodeBodyError> { + fn native_model_encode_body(&self) -> std::result::Result, native_model::EncodeBodyError> { use native_model::Encode; #with::encode(self).map_err(|e| native_model::EncodeBodyError { msg: format!("{}", e),