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/fory.git


The following commit(s) were added to refs/heads/main by this push:
     new 8fb1bc704 fix(rust): fix rust lint error (#2447)
8fb1bc704 is described below

commit 8fb1bc7049ed6dc3903ffa9007a872684773c19b
Author: Shawn Yang <[email protected]>
AuthorDate: Fri Aug 8 17:30:58 2025 +0800

    fix(rust): fix rust lint error (#2447)
    
    ## What does this PR do?
    
    <!-- Describe the purpose of this PR. -->
    
    ## Related issues
    
    <!--
    Is there any related issue? Please attach here.
    
    - #xxxx0
    - #xxxx1
    - #xxxx2
    -->
    
    ## Does this PR introduce any user-facing change?
    
    <!--
    If any user-facing interface changes, please [open an
    issue](https://github.com/apache/fory/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.
    -->
---
 rust/fory-core/src/buffer.rs     | 2 +-
 rust/fory-core/src/row/reader.rs | 5 ++++-
 rust/fory-core/src/row/writer.rs | 6 +++---
 3 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/rust/fory-core/src/buffer.rs b/rust/fory-core/src/buffer.rs
index 78f6aef1d..bd15a9287 100644
--- a/rust/fory-core/src/buffer.rs
+++ b/rust/fory-core/src/buffer.rs
@@ -134,7 +134,7 @@ pub struct Reader<'de> {
 }
 
 impl<'bf> Reader<'bf> {
-    pub fn new(bf: &[u8]) -> Reader {
+    pub fn new(bf: &'bf [u8]) -> Reader<'bf> {
         Reader { bf, cursor: 0 }
     }
 
diff --git a/rust/fory-core/src/row/reader.rs b/rust/fory-core/src/row/reader.rs
index e71fb6e27..1549a55ea 100644
--- a/rust/fory-core/src/row/reader.rs
+++ b/rust/fory-core/src/row/reader.rs
@@ -32,7 +32,10 @@ impl<'a> FieldAccessorHelper<'a> {
         (offset, size)
     }
 
-    pub fn new(row: &[u8], get_field_offset: Box<dyn Fn(usize) -> usize>) -> 
FieldAccessorHelper {
+    pub fn new(
+        row: &'a [u8],
+        get_field_offset: Box<dyn Fn(usize) -> usize>,
+    ) -> FieldAccessorHelper<'a> {
         FieldAccessorHelper {
             row,
             get_field_offset,
diff --git a/rust/fory-core/src/row/writer.rs b/rust/fory-core/src/row/writer.rs
index 2621c41e0..fa3df153a 100644
--- a/rust/fory-core/src/row/writer.rs
+++ b/rust/fory-core/src/row/writer.rs
@@ -71,7 +71,7 @@ impl StructWriter<'_> {
     fn get_fixed_size(bit_map_width_in_bytes: usize, num_fields: usize) -> 
usize {
         bit_map_width_in_bytes + num_fields * 8
     }
-    pub fn new(num_fields: usize, writer: &mut Writer) -> StructWriter {
+    pub fn new(num_fields: usize, writer: &mut Writer) -> StructWriter<'_> {
         let base_offset = writer.len();
         let bit_map_width_in_bytes = 
calculate_bitmap_width_in_bytes(num_fields);
 
@@ -110,7 +110,7 @@ impl ArrayWriter<'_> {
         8 + bit_map_width_in_bytes + num_fields * 8
     }
 
-    pub fn new(num_fields: usize, writer: &mut Writer) -> ArrayWriter {
+    pub fn new(num_fields: usize, writer: &mut Writer) -> ArrayWriter<'_> {
         let base_offset = writer.len();
         let bit_map_width_in_bytes = 
calculate_bitmap_width_in_bytes(num_fields);
         let array_writer = ArrayWriter {
@@ -154,7 +154,7 @@ impl MapWriter<'_> {
         8
     }
 
-    pub fn new(writer: &mut Writer) -> MapWriter {
+    pub fn new(writer: &mut Writer) -> MapWriter<'_> {
         let base_offset = writer.len();
         let array_writer = MapWriter {
             writer,


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

Reply via email to