Skip to content

chore: additional clippy fixes#661

Merged
reubeno merged 1 commit into
mainfrom
clippy-fixes
Aug 27, 2025
Merged

chore: additional clippy fixes#661
reubeno merged 1 commit into
mainfrom
clippy-fixes

Conversation

@reubeno
Copy link
Copy Markdown
Owner

@reubeno reubeno commented Aug 27, 2025

No description provided.

@reubeno reubeno requested a review from Copilot August 27, 2025 23:08
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses additional clippy (Rust linter) warnings and improves code quality. The changes focus on applying clippy suggestions to make the codebase more idiomatic and efficient.

  • Replace to_string() calls with more efficient clone() operations on existing strings
  • Refactor variable declarations to use more idiomatic patterns
  • Update match patterns to use Self:: instead of explicit enum names
  • Add clippy allow attributes for specific cases where warnings are acceptable

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
xtask/src/main.rs Add backticks around shell names in documentation comments
brush-parser/src/error.rs Replace enum patterns with Self:: and add clippy allow attribute
brush-core/src/variables.rs Replace to_string() with clone() for existing string
brush-core/src/shell.rs Replace map_or with map_or_else for lazy evaluation
brush-core/src/completion.rs Replace to_string() with clone() for existing string
brush-core/src/builtins/set.rs Add clippy allow attribute for useless_let_if_seq
brush-core/src/builtins/return_.rs Refactor variable declaration to use if-let expression
brush-core/src/builtins/exit.rs Refactor variable declaration to use if-let expression
.github/workflows/ci.yaml Add --workspace flag to clippy command

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Aug 27, 2025

Test Results

    3 files     20 suites   5m 4s ⏱️
  873 tests   873 ✅ 0 💤 0 ❌
2 599 runs  2 599 ✅ 0 💤 0 ❌

Results for commit af27462.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Aug 27, 2025

Performance Benchmark Report

Benchmark name Baseline (μs) Test/PR (μs) Delta (μs) Delta %
clone_shell_object 17.32 μs 17.19 μs -0.13 μs 🟢 -0.74%
eval_arithmetic 0.14 μs 0.15 μs 0.01 μs ⚪ Unchanged
expand_one_string 1.91 μs 1.89 μs -0.02 μs ⚪ Unchanged
for_loop 22.23 μs 21.94 μs -0.29 μs ⚪ Unchanged
function_call 2.58 μs 2.38 μs -0.20 μs ⚪ Unchanged
instantiate_shell 54.44 μs 54.47 μs 0.03 μs ⚪ Unchanged
instantiate_shell_with_init_scripts 23329.30 μs 22842.79 μs -486.51 μs ⚪ Unchanged
parse_bash_completion 1717.39 μs 1718.85 μs 1.46 μs ⚪ Unchanged
parse_sample_script 1.86 μs 1.88 μs 0.02 μs 🟠 +1.13%
run_echo_builtin_command 15.56 μs 15.54 μs -0.02 μs ⚪ Unchanged
run_one_external_command 2428.72 μs 2285.09 μs -143.62 μs 🟢 -5.91%
tokenize_sample_script 2.87 μs 2.75 μs -0.11 μs 🟢 -4.01%

Code Coverage Report: Only Changed Files listed

Package Base Coverage New Coverage Difference
brush-core/src/builtins/return_.rs 🟢 94.12% 🟢 93.33% 🔴 -0.79%
brush-core/src/jobs.rs 🔴 37.16% 🔴 43.58% 🟢 6.42%
Overall Coverage 🟢 72% 🟢 72.08% 🟢 0.08%

Minimum allowed coverage is 70%, this run produced 72.08%

Test Summary: bash-completion test suite

Outcome Count Percentage
✅ Pass 1310 62.11
❗️ Error 247 11.71
❌ Fail 180 8.53
⏩ Skip 358 16.97
❎ Expected Fail 13 0.62
✔️ Unexpected Pass 1 0.05
📊 Total 2109 100.00

@reubeno reubeno merged commit 6701ecf into main Aug 27, 2025
57 of 58 checks passed
@reubeno reubeno deleted the clippy-fixes branch August 27, 2025 23:22
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.

2 participants