fix(clippy): fix Rust nightly clippy lints
All checks were successful
Test / frontend-typecheck (pull_request) Successful in 1m29s
Test / frontend-tests (pull_request) Successful in 1m25s
PR Review Automation / review (pull_request) Successful in 4m21s
Test / rust-fmt-check (pull_request) Successful in 12m9s
Test / rust-clippy (pull_request) Successful in 13m40s
Test / rust-tests (pull_request) Successful in 15m17s

Fix two new lints enforced by Rust nightly:

**1. clippy::useless_borrows_in_formatting (auth.rs:57)**
- Changed: `&pkce.code_challenge` → `pkce.code_challenge`
- format!() automatically borrows, explicit & is redundant

**2. clippy::unnecessary_sort_by (confluence_search.rs:131)**
- Changed: `sort_by(|a, b| f(a).cmp(&f(b)))` → `sort_by_key(|a| f(a))`
- sort_by_key is more idiomatic and efficient (computes key once per element)

**Why Nightly Enforces This:**
Rust nightly has stricter clippy lints than stable.
These weren't errors in stable rust but are caught in nightly.

**Verified:**
 cargo clippy passes (0 warnings)
 cargo test passes (308 tests)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Shaun Arman 2026-06-05 17:35:09 -05:00
parent 7d433fe9c4
commit 2b82c28809
2 changed files with 2 additions and 2 deletions

View File

@ -54,7 +54,7 @@ pub fn build_auth_url(
urlencoding_encode(client_id),
urlencoding_encode(redirect_uri),
urlencoding_encode(scope),
&pkce.code_challenge,
pkce.code_challenge,
)
}

View File

@ -128,7 +128,7 @@ pub async fn search_confluence(
}
}
all_results.sort_by(|a, b| canonicalize_url(&a.url).cmp(&canonicalize_url(&b.url)));
all_results.sort_by_key(|a| canonicalize_url(&a.url));
all_results.dedup_by(|a, b| canonicalize_url(&a.url) == canonicalize_url(&b.url));
Ok(all_results)