Skip to content

chore(rust): clear all clippy warnings - #386

Open
sunxiaobin89 wants to merge 1 commit into
GOODBOY008:mainfrom
sunxiaobin89:chore/clippy-cleanup
Open

sunxiaobin89 wants to merge 1 commit into
GOODBOY008:mainfrom
sunxiaobin89:chore/clippy-cleanup

Conversation

@sunxiaobin89

Copy link
Copy Markdown
Contributor

Summary

cargo clippy reported 54 warnings on main. This clears all of them without changing behavior.

Auto-fixed (31): needless borrows (19, mostly returned references in lib.rs), manual div_ceil, derivable Default for X11Config, trim() before split_whitespace, get(0) → first(), unused imports.

Manual (23):

  • Remove dead code with no callers: TailLogRequest, SshSession, unused RDP wheel constants, and NativeRenderer::{size, remote_size, present_full}.
  • Scope test-only helpers/imports with #[cfg(test)] instead of deleting: generate_fake_cookie, mpsc in connection_manager, PathBuf in os_keypath.
  • Add the two complex-type aliases DesktopConnection and StreamProgressCallback<'_>.
  • #[allow(clippy::too_many_arguments)] on four hot-path functions where a context struct would obscure the call, and #[allow(clippy::result_large_err)] for tungstenite's fixed accept_hdr_async callback type.

Test plan

  • cargo clippy → 0 warnings (was 54)
  • cargo test --lib → 543 passed / 0 failed / 55 ignored
  • cargo build → success
  • cargo fmt --check was not run as a gate: main already has pre-existing formatting drift under rustfmt 1.9, and normalizing it here would add ~1k unrelated lines

Rust-only change with no UI surface; no frontend files touched.

cargo clippy reported 54 warnings on main. Auto-fix handled 31 machine-
applicable ones (needless borrows, manual div_ceil, derivable Default,
needless trim/get(0)); the rest needed judgement:

- drop dead code: TailLogRequest, SshSession, the unused RDP wheel
  constants, and three NativeRenderer helpers with no callers
- scope test-only helpers/imports with #[cfg(test)] (generate_fake_cookie,
  mpsc in connection_manager, PathBuf in os_keypath) instead of deleting
  them
- type aliases for the two remaining complex types
  (DesktopConnection, StreamProgressCallback)
- allow(clippy::too_many_arguments) where a context struct would obscure
  a hot path, and allow(clippy::result_large_err) where tungstenite's
  callback forces its own ErrorResponse type

No behavior change: cargo test --lib is 543 passed, and the debug binary
still builds. rustfmt was deliberately not run because main already has
pre-existing formatting drift; this keeps the diff reviewable.

This branch has not been deployed

No deployments
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