Skip to content

Commit

Permalink
fix: i8 gen code (#62)
Browse files Browse the repository at this point in the history
fix: i8 gen code
  • Loading branch information
PureWhiteWu authored Nov 22, 2022
1 parent a8e6357 commit cb511ae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pilota-build/src/codegen/thrift/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ impl ThriftBackend {
match &ty.kind {
ty::String => quote! {::pilota::thrift::TType::Binary},
ty::Void => quote! {::pilota::thrift::TType::Void},
ty::U8 => quote! {::pilota::thrift::TType::I08},
ty::U8 => quote! {::pilota::thrift::TType::I8},
ty::Bool => quote! {::pilota::thrift::TType::Bool},
ty::BytesVec | ty::Bytes => quote! {::pilota::thrift::TType::Binary},
ty::I8 => quote! {::pilota::thrift::TType::I08},
ty::I8 => quote! {::pilota::thrift::TType::I8},
ty::I16 => quote! { ::pilota::thrift::TType::I16 },
ty::I32 => quote! { ::pilota::thrift::TType::I32 },
ty::I64 => quote! { ::pilota::thrift::TType::I64 },
Expand Down
3 changes: 2 additions & 1 deletion pilota/src/thrift/binary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ impl<T> TLengthProtocol for TBinaryProtocol<T> {

#[inline]
fn write_bytes_len(&self, b: &[u8]) -> usize {
// FIXME: this will calc the wrong size if T is not LinkedBytes and zero copy is enabled
// FIXME: this will calc the wrong size if T is not LinkedBytes and zero copy is
// enabled
if self.zero_copy && b.len() >= ZERO_COPY_THRESHOLD {
self.write_i32_len(0)
} else {
Expand Down

0 comments on commit cb511ae

Please sign in to comment.