lint: enable redundant_clone, cloned_instead_of_copied, needless_pass_by_ref_mut#781
lint: enable redundant_clone, cloned_instead_of_copied, needless_pass_by_ref_mut#781strawgate wants to merge 2 commits into
Conversation
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Caution Review failedPull request was closed or merged during review WalkthroughThis PR makes multiple coordinated changes: it enables three workspace Clippy lints in Cargo.toml; redesigns conflict-field handling by replacing StructArray conflict columns with double-underscore suffixed flat columns and recording conflict groups in schema metadata ( Possibly related PRs
Caution Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional.
❌ Failed checks (1 error, 3 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches⚔️ Resolve merge conflicts
Comment |
…_by_ref_mut Enabled three performance and correctness lints in the workspace. Fixed existing violations and other minor clippy warnings. Co-authored-by: strawgate <6384545+strawgate@users.noreply.github.com>
e121515 to
c44e2a8
Compare
|
Rebased on master, resolved conflict in conflict_schema.rs (took master's fuller assertions, removed redundant .clone()). All tests pass, clippy clean. |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
crates/logfwd/tests/compliance_file.rs (1)
334-342: 🧹 Nitpick | 🔵 TrivialRename
log_path_cloneto match the new ownership.This value is moved into the writer thread now, not cloned, so the current name is misleading.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@crates/logfwd/tests/compliance_file.rs` around lines 334 - 342, The variable name log_path_clone is misleading because its ownership is moved into the writer thread; rename the binding (where let log_path_clone = log_path;) to something that reflects transfer of ownership (e.g., log_path_owned or log_path_moved) and update any references inside the spawned thread (the closure passed to std::thread::spawn that uses log_path_clone and opens the file) to use the new name; ensure the new binding still takes ownership (no clone()) so the move semantics and writer_handle usage remain unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@crates/logfwd-core/tests/compliance_data.rs`:
- Around line 646-649: The code unnecessarily allocates a String with
key.to_string() before calling get_str; replace that allocation by using the
borrowed key directly (from the closure's key binding) when calling
assert_both_scanners and get_str. Locate the closure passed to
assert_both_scanners and change the usage of the variable produced by
key.to_string() so you pass the borrowed &str (the existing key) directly to
get_str (and remove let col_name = key.to_string()), referencing
assert_both_scanners and get_str to find where to update.
---
Outside diff comments:
In `@crates/logfwd/tests/compliance_file.rs`:
- Around line 334-342: The variable name log_path_clone is misleading because
its ownership is moved into the writer thread; rename the binding (where let
log_path_clone = log_path;) to something that reflects transfer of ownership
(e.g., log_path_owned or log_path_moved) and update any references inside the
spawned thread (the closure passed to std::thread::spawn that uses
log_path_clone and opens the file) to use the new name; ensure the new binding
still takes ownership (no clone()) so the move semantics and writer_handle usage
remain unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: ASSERTIVE
Plan: Pro
Run ID: 7053b22b-98c2-41a2-bd3e-497e50dc4b22
📒 Files selected for processing (28)
Cargo.tomlcrates/logfwd-arrow/src/streaming_builder.rscrates/logfwd-arrow/tests/allocation_regression.rscrates/logfwd-bench/benches/elasticsearch_arrow.rscrates/logfwd-bench/benches/pipeline.rscrates/logfwd-config/src/lib.rscrates/logfwd-core/benches/scanner.rscrates/logfwd-core/examples/arrow_ipc_roundtrip.rscrates/logfwd-core/src/pipeline/lifecycle.rscrates/logfwd-core/tests/compliance_data.rscrates/logfwd-core/tests/scanner_conformance.rscrates/logfwd-io/src/generator.rscrates/logfwd-io/src/metric_history.rscrates/logfwd-io/src/otlp_receiver.rscrates/logfwd-io/tests/transport_e2e.rscrates/logfwd-output/src/lib.rscrates/logfwd-output/src/loki.rscrates/logfwd-output/tests/elasticsearch_arrow_ipc.rscrates/logfwd-test-utils/src/sinks.rscrates/logfwd-transform/src/conflict_schema.rscrates/logfwd-transform/src/lib.rscrates/logfwd/src/pipeline.rscrates/logfwd/src/worker_pool.rscrates/logfwd/tests/allocation_e2e.rscrates/logfwd/tests/allocation_scaling.rscrates/logfwd/tests/compliance.rscrates/logfwd/tests/compliance_file.rscrates/logfwd/tests/integration.rs
Acknowledged. I have enabled the requested performance lints and verified that the workspace is now clippy clean, including the fixes in conflict_schema.rs. |
Co-authored-by: strawgate <6384545+strawgate@users.noreply.github.com>
|
Closing: master has diverged significantly (44 files changed). The lint changes (redundant_clone, cloned_instead_of_copied, needless_pass_by_ref_mut) can be re-applied fresh on current master with |
Understood. Acknowledging that this work is now obsolete due to master divergence and stopping work on this task. |
Enabled three performance and correctness lints (
redundant_clone,cloned_instead_of_copied,needless_pass_by_ref_mut) in[workspace.lints.clippy]of the rootCargo.toml.Executed
cargo clippy --fixto address the initial violations and other minor warnings across the workspace, ensuring a clean linting state. Verified that all lints pass and that existing tests continue to pass.Fixes #764
PR created automatically by Jules for task 3875422540943888202 started by @strawgate