james-willis opened a new issue, #779:
URL: https://github.com/apache/sedona-db/issues/779

   ## Summary
   
   `cargo clippy --workspace --all-targets --all-features -- -Dwarnings` fails
   on `main` with:
   
       error: calls to `push` immediately after creation
         --> python/sedonadb/src/lib.rs:59:5
   
   The offending block:
   
   ```rust
   let mut features = vec![];
   
   #[cfg(feature = "s2geography")]
   features.push("s2geography".to_string());
   
   #[cfg(feature = "gpu")]
   features.push("gpu".to_string());
   ```
   
   ## Why
   
   Rust 1.95's `clippy::vec_init_then_push` was tightened and now fires on this
   construction regardless of which features are active — with both features
   on, both features off, or any combination, the code still matches the
   vec-init-then-push pattern clippy wants you to rewrite as a single
   initializer expression.
   
   ## Provenance
   
   Introduced in `a991238a` ("feat(python/sedonadb): Enable GPU feature in
   python package and add spatial join tests", #768).
   
   ## Reproduction
   
       cargo clippy --workspace --all-targets --all-features -- -Dwarnings
   
   ## Observed on
   
   https://github.com/apache/sedona-db/actions/runs/24683986166/job/72188509313
   
   ## Suggested fix
   
   Either rewrite as a single initializer:
   
   ```rust
   let features: Vec<String> = [
       #[cfg(feature = "s2geography")]
       "s2geography".to_string(),
       #[cfg(feature = "gpu")]
       "gpu".to_string(),
   ]
   .into_iter()
   .collect();
   ```
   
   …or add `#[allow(clippy::vec_init_then_push)]` on the `let` line.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to