Add a uniq test module for yunq in rust.

This commit is contained in:
Drew Galbraith 2024-08-29 21:27:27 -07:00
parent c1db6cb11f
commit 4ee8dc924c
13 changed files with 132 additions and 10 deletions

View file

@ -29,7 +29,13 @@ fn serialize_field(name: &Ident, ind: usize, path: &Path) -> proc_macro2::TokenS
} else if path.is_ident("u64") {
quote! {
{
buf.write_at(yunq::message::field_offset(offset, #ind), self.#name as u64)?;
buf.write_at(yunq::message::field_offset(offset, #ind), self.#name)?;
}
}
} else if path.is_ident("i64") {
quote! {
{
buf.write_at(yunq::message::field_offset(offset, #ind), self.#name)?;
}
}
} else {
@ -67,6 +73,10 @@ fn parse_field(name: &Ident, ind: usize, path: &Path) -> proc_macro2::TokenStrea
quote! {
let #name = buf.at::<u64>(yunq::message::field_offset(offset, #ind))?;
}
} else if path.is_ident("i64") {
quote! {
let #name = buf.at::<i64>(yunq::message::field_offset(offset, #ind))?;
}
} else {
quote! {
let #name = {