I've encountered an issue while using Polars version 0.37.0 and running cargo clippy for code checking. The error arises in the polars-arrow-0.37.0 crate, specifically in the utf8_to.rs file. Below is the detailed error message:
error[E0308]: `if` and `else` have incompatible types
--> /Users/me/.cargo/registry/src/index.crates.io-6f17d22bba15001f/polars-arrow-0.37.0/src/compute/cast/utf8_to.rs:101:9
|
98 | let buffers = if uses_buffer {
| ___________________-
99 | | Arc::from([arr.values().clone()])
| | --------------------------------- expected because of this
100 | | } else {
101 | | Arc::from([])
| | ^^^^^^^^^^^^^ expected an array with a fixed size of 1 element, found one with 0 elements
102 | | };
| |_____- `if` and `else` have incompatible types
|
= note: expected struct `Arc<[buffer::immutable::Buffer<u8>; 1]>`
found struct `Arc<[_; 0]>`
Any guidance or suggestions on how to address this issue would be greatly appreciated. If further information is needed, I am happy to provide it.
[I added minimal reproducible example!]
minimal reproducible example:
main.rs:
fn main() {}
Cargo.toml:
[package]
name = "polars-test-me"
version = "0.1.0"
edition = "2021"
[dependencies]
polars = "0.37.0"
cargo command:
$ cargo clippy
Rust version information:
$ rustc -V
rustc 1.72.0 (5680fa18f 2023-08-23)
$ cargo --version
cargo 1.72.0 (103a7ff2e 2023-08-15)
$ cargo clippy -V
clippy 0.1.72 (5680fa18 2023-08-23)