This is an automated email from the ASF dual-hosted git repository.

chaokunyang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/fury.git


The following commit(s) were added to refs/heads/main by this push:
     new 7052beec ci: fix rust ci failed (#1783)
7052beec is described below

commit 7052beece1dcb478565d17656630f4a6dbc3a356
Author: LiangliangSui <[email protected]>
AuthorDate: Thu Aug 1 23:26:38 2024 +0800

    ci: fix rust ci failed (#1783)
    
    <!--
    **Thanks for contributing to Fury.**
    
    **If this is your first time opening a PR on fury, you can refer to
    
[CONTRIBUTING.md](https://github.com/apache/fury/blob/main/CONTRIBUTING.md).**
    
    Contribution Checklist
    
    - The **Apache Fury (incubating)** community has restrictions on the
    naming of pr titles. You can also find instructions in
    [CONTRIBUTING.md](https://github.com/apache/fury/blob/main/CONTRIBUTING.md).
    
    - Fury has a strong focus on performance. If the PR you submit will have
    an impact on performance, please benchmark it first and provide the
    benchmark result here.
    -->
    
    ## What does this PR do?
    
    <!-- Describe the purpose of this PR. -->
    fix rust ci failed
    
    
    ## Related issues
    
    <!--
    Is there any related issue? Please attach here.
    
    - #xxxx0
    - #xxxx1
    - #xxxx2
    -->
    https://github.com/apache/fury/issues/1781
    
    
    ## Does this PR introduce any user-facing change?
    
    <!--
    If any user-facing interface changes, please [open an
    issue](https://github.com/apache/fury/issues/new/choose) describing the
    need to do so and update the document if necessary.
    -->
    
    - [ ] Does this PR introduce any public API change?
    - [ ] Does this PR introduce any binary protocol compatibility change?
    
    
    ## Benchmark
    
    <!--
    When the PR has an impact on performance (if you don't know whether the
    PR will have an impact on performance, you can submit the PR first, and
    if it will have impact on performance, the code reviewer will explain
    it), be sure to attach a benchmark data here.
    -->
    
    Signed-off-by: LiangliangSui <[email protected]>
---
 rust/fury/src/serializer.rs | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/rust/fury/src/serializer.rs b/rust/fury/src/serializer.rs
index 231e672f..3c253ce2 100644
--- a/rust/fury/src/serializer.rs
+++ b/rust/fury/src/serializer.rs
@@ -49,7 +49,7 @@ fn to_u8_slice<T>(slice: &[T]) -> &[u8] {
 /// Types that implement the Serialize trait can be serialized to Fury.
 ///
 /// 1. Normal situation:
-/// The order of function calls is reserved_space -> serialize -> write.
+///    The order of function calls is reserved_space -> serialize -> write.
 ///     a. reserved_space is used to allocate the fixed memory space, which 
can avoid the cost of the memory check.
 ///         However, dynamic types like strings should allocate the size 
separately before being written to the buffer.
 ///     b. serialize is used to serialize the data into the buffer. The first 
step is to write the object head,
@@ -57,10 +57,10 @@ fn to_u8_slice<T>(slice: &[T]) -> &[u8] {
 ///         The second step is to call the write function, which is used to 
write the Rust object.
 ///     c. write is used to write the Rust object into the buffer.
 /// 2. Vec situation:
-/// If the object is in a Vec, the call order is reserved_space -> serialize 
-> write -> write_vec.
-/// The write_vec function is used to write the elements of the Vec. But why 
can't we just loop through the elements and write each element one by one?
-/// This is because Fury includes some primitive types like 
FuryPrimitiveBoolArray which do not include the head of the elements,
-/// but other Vecs do. So the write_vec function is necessary to handle the 
differences. Primitive arrays can overwrite the function.
+///    If the object is in a Vec, the call order is reserved_space -> 
serialize -> write -> write_vec.
+///    The write_vec function is used to write the elements of the Vec. But 
why can't we just loop through the elements and write each element one by one?
+///    This is because Fury includes some primitive types like 
FuryPrimitiveBoolArray which do not include the head of the elements,
+///    but other Vecs do. So the write_vec function is necessary to handle the 
differences. Primitive arrays can overwrite the function.
 pub trait Serialize
 where
     Self: Sized + FuryMeta,


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to