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

mgrigorov pushed a commit to branch fix-build-with-nightly-06-06-2025
in repository https://gitbox.apache.org/repos/asf/avro-rs.git

commit 6d81ad0ed9fb644dc59e6fdb391edb643f06baef
Author: Martin Tzvetanov Grigorov <[email protected]>
AuthorDate: Fri Jun 6 11:39:03 2025 +0300

    chore: Fix the build with latest nightly compiler (06.06.2025)
    
    Error:
    ```
    error: lifetime flowing from input to output with different syntax can be 
confusing
       --> avro/src/types.rs:238:24
        |
    238 |     pub fn new(schema: &Schema) -> Option<Record> {
        |                        ^^^^^^^            ------ the lifetime gets 
resolved as `'_`
        |                        |
        |                        this lifetime flows to the output
        |
        = note: `-D mismatched-lifetime-syntaxes` implied by `-D warnings`
        = help: to override `-D warnings` add 
`#[allow(mismatched_lifetime_syntaxes)]`
    help: one option is to remove the lifetime for references and use the 
anonymous lifetime for paths
        |
    238 |     pub fn new(schema: &Schema) -> Option<Record<'_>> {
        |                                                 ++++
    ```
    
    Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
---
 avro/src/types.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/avro/src/types.rs b/avro/src/types.rs
index 4f7c40f..fe88bfe 100644
--- a/avro/src/types.rs
+++ b/avro/src/types.rs
@@ -235,7 +235,7 @@ impl Record<'_> {
     /// Create a `Record` given a `Schema`.
     ///
     /// If the `Schema` is not a `Schema::Record` variant, `None` will be 
returned.
-    pub fn new(schema: &Schema) -> Option<Record> {
+    pub fn new(schema: &Schema) -> Option<Record<'_>> {
         match *schema {
             Schema::Record(RecordSchema {
                 fields: ref schema_fields,

Reply via email to