From bd1a1f9ecab3753e49befae5fce48071fba0a0c1 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Mon, 8 Jul 2024 15:53:43 +0200 Subject: [PATCH 1/3] Update to Rust 1.76 --- .github/workflows/integration-ffi.yml | 4 ++-- .github/workflows/test.yml | 10 +++++----- Cargo.toml | 2 +- rust-toolchain.toml | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/integration-ffi.yml b/.github/workflows/integration-ffi.yml index ccb7c0cba6..9037bd4d64 100644 --- a/.github/workflows/integration-ffi.yml +++ b/.github/workflows/integration-ffi.yml @@ -10,8 +10,8 @@ jobs: - uses: actions/checkout@v2 - name: Setup Rust toolchain run: | - rustup toolchain install 1.72.1 - rustup default 1.72.1 + rustup toolchain install 1.76.0 + rustup default 1.76.0 rustup component add rustfmt clippy - name: Cache Cargo uses: actions/cache@v2 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a2580f5dc1..eb02e158d7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,7 +10,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Install Rust - run: rustup update 1.72.1 + run: rustup update 1.76.0 - name: Setup parquet files run: | apt update && apt install python3-pip python3-venv -y -q @@ -34,7 +34,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Install Rust - run: rustup update 1.72.1 + run: rustup update 1.76.0 - uses: Swatinem/rust-cache@v1 - name: Run shell: bash @@ -48,7 +48,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Install Rust - run: rustup update 1.72.1 + run: rustup update 1.76.0 - uses: Swatinem/rust-cache@v1 - name: Install clippy run: rustup component add clippy @@ -61,7 +61,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Install Rust - run: rustup update 1.72.1 + run: rustup update 1.76.0 - uses: Swatinem/rust-cache@v1 - name: Install rustfmt run: rustup component add rustfmt @@ -133,7 +133,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Install Rust - run: rustup update 1.72.1 + run: rustup update 1.76.0 - name: Setup all features run: cargo install cargo-all-features - uses: Swatinem/rust-cache@v1 diff --git a/Cargo.toml b/Cargo.toml index 42a78625e3..c711d01e47 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ authors = [ ] keywords = ["arrow", "analytics"] edition = "2021" -rust-version = "1.72" +rust-version = "1.76" exclude = ["testing/"] [lib] diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 7e8f0a9aab..83a52c3838 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "1.72" +channel = "1.76" From ea03a8fc64c0ebfaf0ded2ae6a95a882702ebac6 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Mon, 8 Jul 2024 15:59:50 +0200 Subject: [PATCH 2/3] Fix clippy lints --- Cargo.toml | 8 ++++++++ src/array/growable/structure.rs | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index c711d01e47..ce228444c6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -306,6 +306,14 @@ rustc_version = "0.4.0" [package.metadata.cargo-all-features] allowlist = ["compute", "compute_sort", "compute_hash", "compute_nullif"] +# --------------------------------------------------------------------------------- + +[lints.clippy] +blocks_in_conditions = "allow" +manual_hash_one = "allow" + +# --------------------------------------------------------------------------------- + [[bench]] name = "take_kernels" harness = false diff --git a/src/array/growable/structure.rs b/src/array/growable/structure.rs index b1242e08a4..ddf5899422 100644 --- a/src/array/growable/structure.rs +++ b/src/array/growable/structure.rs @@ -109,7 +109,7 @@ impl<'a> Growable<'a> for GrowableStruct<'a> { // All children should have the same indexing, so just use the first // one. If we don't have children, we might still have a validity // array, so use that. - if let Some(child) = self.values.get(0) { + if let Some(child) = self.values.first() { child.len() } else { self.validity.len() From c6f4d317509cda76136939df5b19fad63a123ce6 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Mon, 8 Jul 2024 16:04:41 +0200 Subject: [PATCH 3/3] Silence more clippy lints --- Cargo.toml | 6 ++++++ tests/it/ffi/data.rs | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index ce228444c6..9780e6466e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -308,9 +308,15 @@ allowlist = ["compute", "compute_sort", "compute_hash", "compute_nullif"] # --------------------------------------------------------------------------------- +[lints.rust] +unused_imports = "allow" + [lints.clippy] blocks_in_conditions = "allow" +items_after_test_module = "allow" manual_hash_one = "allow" +non_canonical_partial_ord_impl = "allow" +redundant_guards = "allow" # --------------------------------------------------------------------------------- diff --git a/tests/it/ffi/data.rs b/tests/it/ffi/data.rs index 31bacb8387..b7f303a9b4 100644 --- a/tests/it/ffi/data.rs +++ b/tests/it/ffi/data.rs @@ -342,7 +342,7 @@ fn extension() -> Result<()> { DataType::Extension( "a".to_string(), Arc::new(DataType::Int32), - Some("bla".to_string()).map(Arc::new), + Some(Arc::new("bla".to_string())), ), true, );