fix: unknown result on macro

This commit is contained in:
Vincent Herlemont
2023-10-29 09:39:40 +01:00
parent fd5bbfd964
commit 789f09fa67
2 changed files with 2 additions and 2 deletions
@@ -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<u8>, id: u32) -> Result<Self, native_model::DecodeBodyError> {
fn native_model_decode_body(data: Vec<u8>, id: u32) -> std::result::Result<Self, native_model::DecodeBodyError> {
println!("id: {}, {}", id, #id);
if id != #id {
return Err(native_model::DecodeBodyError::MismatchedModelId);
@@ -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<Vec<u8>, native_model::EncodeBodyError> {
fn native_model_encode_body(&self) -> std::result::Result<Vec<u8>, native_model::EncodeBodyError> {
use native_model::Encode;
#with::encode(self).map_err(|e| native_model::EncodeBodyError {
msg: format!("{}", e),