mirror of
https://github.com/Drop-OSS/drop
synced 2026-08-27 14:23:05 -04:00
fix: unknown result on macro
This commit is contained in:
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),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue