Skip to content

style: fix clippy::redundant_clone warning#233

Merged
Brooooooklyn merged 2 commits into
mainfrom
fix/clippy-very-low-priority
Oct 17, 2025
Merged

style: fix clippy::redundant_clone warning#233
Brooooooklyn merged 2 commits into
mainfrom
fix/clippy-very-low-priority

Conversation

@Brooooooklyn

Copy link
Copy Markdown
Member

style: fix clippy::redundant_clone warning

Remove unnecessary to_owned() call in raw_exec.rs. The name variable
is already owned and being moved into the closure, so cloning it is
redundant.

Fixed 1 occurrence in:

  • crates/fspy_preload_unix/src/client/raw_exec.rs

All tests pass and clippy is clean with -D clippy::redundant_clone.

🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

style: fix clippy::pedantic and clippy::nursery warnings

This commit addresses warnings from the pedantic and nursery lint groups:

Auto-fixed (57 warnings):

  • Converted manual range slicing to .take() method calls
  • Updated uninlined format arguments
  • Simplified redundant field names in struct initialization
  • Other automated fixes across 23 files

Manual fixes:

  1. build.rs: Added underscores to long integer literals for readability

    • Fixed 4 occurrences of literals > 100 digits
  2. which.rs: Replaced unsafe transmute with proper pointer operations

    • Used std::ptr::copy_nonoverlapping for safe byte copying
    • Added explicit type annotations for clarity
  3. exec/mod.rs:

    • Replaced Default::default() with explicit ParseShebangOptions::default()
    • Converted nested if-let to Option::map_or_else for PATH resolution
  4. Documentation: Added missing # Errors and # Panics sections

    • payload.rs: encode_payload function
    • spawn/mod.rs: handle_exec function
    • vite_path lib.rs: current_dir function
    • absolute.rs: strip_prefix method
    • relative.rs: strip_prefix method
  5. vite_path/relative.rs: Added #[allow(clippy::unsafe_derive_deserialize)]

    • Safe to derive Deserialize as validation happens at construction time
  6. vite_tui/app.rs:

    • Changed App::new() from Result<Self> to Self (no errors possible)
    • Replaced wildcard match arm with explicit Action::Error(_) variant

All tests pass successfully after these changes.

🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

Brooooooklyn commented Oct 16, 2025

Copy link
Copy Markdown
Member Author

Comment thread crates/fspy_shared_unix/src/exec/shebang.rs
@Brooooooklyn
Brooooooklyn force-pushed the fix/clippy-very-low-priority branch 3 times, most recently from fb052f8 to d4885a3 Compare October 17, 2025 02:25
@Brooooooklyn
Brooooooklyn force-pushed the fix/clippy-very-low-priority branch from d4885a3 to 0ff932c Compare October 17, 2025 06:02

Brooooooklyn commented Oct 17, 2025

Copy link
Copy Markdown
Member Author

Merge activity

  • Oct 17, 6:08 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Oct 17, 6:23 AM UTC: Graphite rebased this pull request as part of a merge.
  • Oct 17, 6:27 AM UTC: @Brooooooklyn merged this pull request with Graphite.

@Brooooooklyn
Brooooooklyn changed the base branch from fix/clippy-uninlined-format-args to graphite-base/233 October 17, 2025 06:15
@Brooooooklyn
Brooooooklyn changed the base branch from graphite-base/233 to main October 17, 2025 06:21
Brooooooklyn and others added 2 commits October 17, 2025 06:22
Remove unnecessary `to_owned()` call in raw_exec.rs. The `name` variable
is already owned and being moved into the closure, so cloning it is
redundant.

Fixed 1 occurrence in:
- crates/fspy_preload_unix/src/client/raw_exec.rs

All tests pass and clippy is clean with -D clippy::redundant_clone.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit addresses warnings from the pedantic and nursery lint groups:

**Auto-fixed (57 warnings):**
- Converted manual range slicing to `.take()` method calls
- Updated uninlined format arguments
- Simplified redundant field names in struct initialization
- Other automated fixes across 23 files

**Manual fixes:**

1. **build.rs**: Added underscores to long integer literals for readability
   - Fixed 4 occurrences of literals > 100 digits

2. **which.rs**: Replaced unsafe transmute with proper pointer operations
   - Used `std::ptr::copy_nonoverlapping` for safe byte copying
   - Added explicit type annotations for clarity

3. **exec/mod.rs**:
   - Replaced `Default::default()` with explicit `ParseShebangOptions::default()`
   - Converted nested if-let to `Option::map_or_else` for PATH resolution

4. **Documentation**: Added missing `# Errors` and `# Panics` sections
   - payload.rs: encode_payload function
   - spawn/mod.rs: handle_exec function
   - vite_path lib.rs: current_dir function
   - absolute.rs: strip_prefix method
   - relative.rs: strip_prefix method

5. **vite_path/relative.rs**: Added `#[allow(clippy::unsafe_derive_deserialize)]`
   - Safe to derive Deserialize as validation happens at construction time

6. **vite_tui/app.rs**:
   - Changed `App::new()` from `Result<Self>` to `Self` (no errors possible)
   - Replaced wildcard match arm with explicit `Action::Error(_)` variant

All tests pass successfully after these changes.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@Brooooooklyn
Brooooooklyn force-pushed the fix/clippy-very-low-priority branch from 0ff932c to c703cea Compare October 17, 2025 06:22
@Brooooooklyn
Brooooooklyn merged commit 2d9277f into main Oct 17, 2025
9 checks passed
@Brooooooklyn
Brooooooklyn deleted the fix/clippy-very-low-priority branch October 17, 2025 06:27
wan9chi pushed a commit that referenced this pull request Mar 12, 2026
- feat: add pre/post lifecycle hooks for package.json scripts (#231)
- feat: fast-fail execution when a task fails (#233)

Also syncs run-config.ts types for new `enablePrePostScripts` option.

https://claude.ai/code/session_0139LsSbe67hcD8NKKaK6Y8U
fengmk2 pushed a commit that referenced this pull request Mar 12, 2026
## Summary
- Bump vite-task dependency from `7e28617` to `28f371a` (latest main)
- Picks up:
  - feat: add pre/post lifecycle hooks for package.json scripts (#231)
  - feat: fast-fail execution when a task fails (#233)
- Syncs `run-config.ts` types for new `enablePrePostScripts` option

## Test plan
- [x] `cargo check --all-targets --all-features` passes
- [x] `cargo test -p vite-plus-cli` passes (22 tests)
- [x] `run-config.ts` types synced
- [ ] CI passes
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