mirror of
https://github.com/Drop-OSS/drop.git
synced 2026-06-22 04:11:32 +10:00
fix: unknown result on macro
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user