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

pandalee 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 f68fdac6 fix(rust): fix rust lint error (#2373)
f68fdac6 is described below

commit f68fdac6aefcafdb4dcd589753c417dee94a5705
Author: Shawn Yang <[email protected]>
AuthorDate: Sun Jun 29 00:09:50 2025 +0800

    fix(rust): fix rust lint error (#2373)
    
    ## What does this PR do?
    
    <!-- Describe the purpose of this PR. -->
    
    ## Related issues
    
    Closes #2370
    
    ## 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-derive/src/fory_row.rs        | 5 ++---
 rust/tests/tests/test_complex_struct.rs | 2 +-
 rust/tests/tests/test_util.rs           | 6 +++---
 3 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/rust/fory-derive/src/fory_row.rs b/rust/fory-derive/src/fory_row.rs
index 928b0163..eea9758a 100644
--- a/rust/fory-derive/src/fory_row.rs
+++ b/rust/fory-derive/src/fory_row.rs
@@ -42,7 +42,7 @@ pub fn derive_row(ast: &syn::DeriveInput) -> TokenStream {
     let getter_exprs = fields.iter().enumerate().map(|(index, field)| {
         let ty = &field.ty;
         let ident = field.ident.as_ref().expect("field should provide ident");
-        let getter_name: proc_macro2::Ident = syn::Ident::new(&format!("{}", 
ident), ident.span());
+        let getter_name: proc_macro2::Ident = 
syn::Ident::new(&format!("{ident}"), ident.span());
 
         quote! {
             pub fn #getter_name(&self) -> <#ty as 
fory_core::row::Row<'a>>::ReadResult {
@@ -52,8 +52,7 @@ pub fn derive_row(ast: &syn::DeriveInput) -> TokenStream {
         }
     });
 
-    let getter: proc_macro2::Ident =
-        syn::Ident::new(&format!("{}ForyRowGetter", name), name.span());
+    let getter: proc_macro2::Ident = 
syn::Ident::new(&format!("{name}ForyRowGetter"), name.span());
 
     let num_fields = fields.len();
 
diff --git a/rust/tests/tests/test_complex_struct.rs 
b/rust/tests/tests/test_complex_struct.rs
index 143c93b8..840a2da9 100644
--- a/rust/tests/tests/test_complex_struct.rs
+++ b/rust/tests/tests/test_complex_struct.rs
@@ -150,5 +150,5 @@ fn encode_to_obin() {
         f10: HashMap::from([(1, 1.0), (2, 2.0)]),
     });
 
-    print!("{:?}", bin);
+    print!("{bin:?}");
 }
diff --git a/rust/tests/tests/test_util.rs b/rust/tests/tests/test_util.rs
index d52e66c7..c78e18df 100644
--- a/rust/tests/tests/test_util.rs
+++ b/rust/tests/tests/test_util.rs
@@ -25,19 +25,19 @@ fn test_to_utf8() {
     println!("==========init utf16:");
     let utf16_strings: Vec<String> = utf16_bytes
         .iter()
-        .map(|&byte| format!("0x{:04x}", byte))
+        .map(|&byte| format!("0x{byte:04x}"))
         .collect();
     println!("{}", utf16_strings.join(","));
     let utf8_bytes = to_utf8(&utf16_bytes, is_little_endian).unwrap();
     println!("==========utf8:");
     let utf8_strings: Vec<String> = utf8_bytes
         .iter()
-        .map(|&byte| format!("0x{:02x}", byte))
+        .map(|&byte| format!("0x{byte:02x}"))
         .collect();
     println!("{}", utf8_strings.join(","));
     // final UTF-8 string
     let final_string = String::from_utf8(utf8_bytes.clone()).unwrap();
-    println!("final string: {}", final_string);
+    println!("final string: {final_string}");
     assert_eq!(s, final_string);
 }
 


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

Reply via email to