Skip to content

Refactor for clippy and speed#32

Open
gintsgints wants to merge 15 commits into
mainfrom
refactor
Open

Refactor for clippy and speed#32
gintsgints wants to merge 15 commits into
mainfrom
refactor

Conversation

@gintsgints

Copy link
Copy Markdown
Collaborator

No description provided.

gintsgints and others added 15 commits June 14, 2026 10:57
In the steady state (heap at capacity), every faster query freed the
evicted entry's Vec and allocated a fresh one via record.to_vec(). Reuse
the popped buffer (clear + extend_from_slice) so eviction allocates only
when the new record exceeds the recycled capacity.

On `slow top` over a large pgbench log this halves total allocation
blocks (1,483 -> 726) with no behavior change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Inline the variable into the format! string in tests/errors.rs and tick
the task off in REFACTOR.md.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Remove `-> Result<(), Box<dyn std::error::Error>>` and trailing `Ok(())`
from the 27 integration tests that never use `?`. Tests that genuinely
use the try-operator keep their Result return type.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- cli.rs: extract errors_command()
- main.rs: extract handle_errors_command()
- output_results: extract compute_ranges(), process_with_context(),
  process_parallel()

Behavior unchanged; ticks the too_many_lines and unnecessary_wraps
tasks in REFACTOR.md.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- duration.rs: parse ns/us via Duration::from_secs_f64, matching the
  ms/s/min branches (also rounds instead of truncating).
- error_histogram.rs: store bucket counts as usize and compute the bar
  width with integer rounding instead of float casts.

Ticks the numeric-cast tasks in REFACTOR.md.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- filter_contains_ci.rs: take &str in new() (needless_pass_by_value)
- output_results.rs: elide lifetime on record_passes (elidable_lifetime_names)

cargo clippy --all-targets -- -W clippy::pedantic now reports zero warnings.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@gintsgints gintsgints requested a review from kmoppel June 14, 2026 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant