You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Martin Tzvetanov Grigorov (Jira)" <ji...@apache.org> on 2022/08/12 07:25:00 UTC

[jira] [Created] (AVRO-3608) Rust: Fix clippy errors in Rust 1.63.0

Martin Tzvetanov Grigorov created AVRO-3608:
-----------------------------------------------

             Summary: Rust: Fix clippy errors in Rust 1.63.0
                 Key: AVRO-3608
                 URL: https://issues.apache.org/jira/browse/AVRO-3608
             Project: Apache Avro
          Issue Type: Improvement
          Components: rust
            Reporter: Martin Tzvetanov Grigorov
            Assignee: Martin Tzvetanov Grigorov


Rust clippy (lint) checks fail after the release of Rust 1.63.0.

 
{code:java}
 error: you are deriving `PartialEq` and can implement `Eq`
  --> avro/src/codec.rs:37:30
   |
37 | #[derive(Clone, Copy, Debug, PartialEq, EnumIter, EnumString, IntoStaticStr)]
   |                              ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
   |
   = note: `-D clippy::derive-partial-eq-without-eq` implied by `-D clippy::all`
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eqerror: you are deriving `PartialEq` and can implement `Eq`
  --> avro/src/duration.rs:30:30
   |
30 | #[derive(Debug, Copy, Clone, PartialEq)]
   |                              ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eqerror: you are deriving `PartialEq` and can implement `Eq`
  --> avro/src/duration.rs:57:30
   |
57 | #[derive(Debug, Copy, Clone, PartialEq)]
   |                              ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eqerror: you are deriving `PartialEq` and can implement `Eq`
  --> avro/src/duration.rs:84:30
   |
84 | #[derive(Debug, Copy, Clone, PartialEq)]
   |                              ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eqerror: deref on an immutable reference
   --> avro/src/encode.rs:153:33
    |
153 |                 encode_internal(&*item, inner_schema, names, enclosing_namespace, buffer)?;
    |                                 ^^^^^^
    |
    = note: `-D clippy::borrow-deref-ref` implied by `-D clippy::all`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_deref_ref
help: if you would like to reborrow, try removing `&*`
    |
153 |                 encode_internal(item, inner_schema, names, enclosing_namespace, buffer)?;
    |                                 ~~~~
help: if you would like to deref, try using `&**`
    |
153 |                 encode_internal(&**item, inner_schema, names, enclosing_namespace, buffer)?;
    |                                 ~~~~~~~error: you are deriving `PartialEq` and can implement `Eq`
   --> avro/src/schema.rs:581:24
    |
581 | #[derive(Clone, Debug, PartialEq, EnumString)]
    |                        ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eqerror: unneeded `return` statement
   --> avro/src/types.rs:372:21
    |
372 | /                     return Some(format!(
373 | |                         "Unresolved schema reference: '{}'. Parsed names: {:?}",
374 | |                         name,
375 | |                         names.keys()
376 | |                     ));
    | |_______________________^
    |
    = note: `-D clippy::needless-return` implied by `-D clippy::all`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
    |
372 ~                     Some(format!(
373 +                         "Unresolved schema reference: '{}'. Parsed names: {:?}",
374 +                         name,
375 +                         names.keys()
376 +                     ))
    |error: could not compile `apache-avro` due to 7 previous errors
warning: build failed, waiting for other jobs to finish...
error: could not compile `apache-avro` due to 7 previous errors
{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)