You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@avro.apache.org by mg...@apache.org on 2022/12/16 07:54:05 UTC

[avro] branch master updated: Fix minor warnings from rust 1.66.0 (#2018)

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

mgrigorov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/avro.git


The following commit(s) were added to refs/heads/master by this push:
     new 5016cd5c3 Fix minor warnings from rust 1.66.0 (#2018)
5016cd5c3 is described below

commit 5016cd5c3f2054ebacce7983785c228798e47f59
Author: Martin Grigorov <ma...@users.noreply.github.com>
AuthorDate: Fri Dec 16 09:53:59 2022 +0200

    Fix minor warnings from rust 1.66.0 (#2018)
    
    * Fix lint error in IT test
    
    error: casting to the same type is unnecessary (`i64` -> `i64`)
       --> avro/tests/io.rs:135:64
        |
    135 |         let encoded = to_avro_datum(&Schema::Long, Value::Long(*number as i64)).unwrap();
        |                                                                ^^^^^^^^^^^^^^ help: try: `*number`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
        = note: `-D clippy::unnecessary-cast` implied by `-D clippy::all`
    
    Signed-off-by: Martin Tzvetanov Grigorov <mg...@apache.org>
    
    * Fix lint warning in rustdoc
    
    warning: unclosed HTML tag `Value`
       --> avro/src/writer.rs:459:23
        |
    459 |     /// Write the Into<Value> to the provided Write object. Returns a result with the number
        |                       ^^^^^^^
        |
        = note: `#[warn(rustdoc::invalid_html_tags)]` on by default
    help: try marking as source code
        |
    459 |     /// Write the `Into<Value>` to the provided Write object. Returns a result with the number
        |                   +           +
    
    warning: `apache-avro` (lib doc) generated 1 warning
    
    Signed-off-by: Martin Tzvetanov Grigorov <mg...@apache.org>
    
    * Remove a non-existing label that dependabot tries to set when creating a PR
    
    Signed-off-by: Martin Tzvetanov Grigorov <mg...@apache.org>
    
    Signed-off-by: Martin Tzvetanov Grigorov <mg...@apache.org>
---
 .github/dependabot.yml       | 1 -
 lang/rust/avro/src/writer.rs | 2 +-
 lang/rust/avro/tests/io.rs   | 2 +-
 3 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/.github/dependabot.yml b/.github/dependabot.yml
index 300539e2e..0059d8f55 100644
--- a/.github/dependabot.yml
+++ b/.github/dependabot.yml
@@ -85,7 +85,6 @@ updates:
       interval: "daily"
     open-pull-requests-limit: 20
     target-branch: master
-    labels: [auto-dependencies]
 
   - package-ecosystem: "github-actions"
     directory: "/"
diff --git a/lang/rust/avro/src/writer.rs b/lang/rust/avro/src/writer.rs
index 3bc5c5122..82a5b1387 100644
--- a/lang/rust/avro/src/writer.rs
+++ b/lang/rust/avro/src/writer.rs
@@ -456,7 +456,7 @@ impl<T> SpecificSingleObjectWriter<T>
 where
     T: AvroSchema + Into<Value>,
 {
-    /// Write the Into<Value> to the provided Write object. Returns a result with the number
+    /// Write the `Into<Value>` to the provided Write object. Returns a result with the number
     /// of bytes written including the header
     pub fn write_value<W: Write>(&mut self, data: T, writer: &mut W) -> AvroResult<usize> {
         let v: Value = data.into();
diff --git a/lang/rust/avro/tests/io.rs b/lang/rust/avro/tests/io.rs
index e3d8a6836..fc316b060 100644
--- a/lang/rust/avro/tests/io.rs
+++ b/lang/rust/avro/tests/io.rs
@@ -132,7 +132,7 @@ fn test_binary_int_encoding() {
 #[test]
 fn test_binary_long_encoding() {
     for (number, hex_encoding) in BINARY_ENCODINGS.iter() {
-        let encoded = to_avro_datum(&Schema::Long, Value::Long(*number as i64)).unwrap();
+        let encoded = to_avro_datum(&Schema::Long, Value::Long(*number)).unwrap();
         assert_eq!(&encoded, hex_encoding);
     }
 }