🧹 Refactor capabilities function for readability - #36
Conversation
Extracted the OS-specific blocks from `capabilities()` in `src/lib.rs` into `linux_capabilities()` and `non_linux_capabilities()` to fix the overly long function code health issue. Co-authored-by: undivisible <136312656+undivisible@users.noreply.github.com>
|
👋 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. |
- Added `#[allow(clippy::chunks_exact_to_as_chunks)]` in `src/cdp.rs` to fix build failures caused by a new clippy lint triggered on stable toolchains (rustc 1.98.0 in CI). - Updated `event-listener` to v5.4.2 to resolve `RUSTSEC-2026-0221` flagged by `cargo audit` in CI. Co-authored-by: undivisible <136312656+undivisible@users.noreply.github.com>
…capabilities-15435964603073314652 # Conflicts: # src/cdp.rs
Updated the `chacha20` crate from v0.10.1 (which was recently yanked) to v0.10.2 via `cargo update -p chacha20`. This fixes a CI pipeline breakage during `cargo audit --deny warnings`. Co-authored-by: undivisible <136312656+undivisible@users.noreply.github.com>
Version 0.10.1 of chacha20 was yanked, causing `cargo audit` to fail in CI. Upgraded to 0.10.2. Also includes the `capabilities` refactor and clippy fix from earlier. Co-authored-by: undivisible <136312656+undivisible@users.noreply.github.com>
🎯 What: Extracted the OS-specific blocks from
capabilities()insrc/lib.rsintolinux_capabilities()andnon_linux_capabilities().💡 Why: This fixes an overly long (150+ lines) monolithic function, making the
Executor for NativeExecutorblock significantly more readable and maintainable.✅ Verification: Ran
cargo clippyandcargo testwhich confirmed no regressions in functionality.✨ Result: A more readable, idiomatic Rust struct implementation leveraging conditionally compiled helpers.
PR created automatically by Jules for task 15435964603073314652 started by @undivisible
Note
Low Risk
Mechanical extract-method refactor with no intended behavior change; only test formatting aside from the move.
Overview
NativeExecutor::capabilities()is slimmed down by moving the large#[cfg]branches intolinux_capabilities()andnon_linux_capabilities()onNativeExecutor. The trait implementation now only picks the Linux vs non-Linux helper; capability logic (ATSPI permissions, supported actions, delivery routes, display geometry hashing) is unchanged in behavior.tests/cli.rsfixes indentation in the CLI test helper’s stdinwrite_allblock.Reviewed by Cursor Bugbot for commit b66d8ed. Configure here.