Skip to content

Commit 7102187

Browse files
committed
Fix Clippy lints for stable CI
1 parent 9da5204 commit 7102187

3 files changed

Lines changed: 5 additions & 7 deletions

File tree

‎src/demo.rs‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -516,10 +516,9 @@ pub fn run_demo<W: Write>(opts: &DemoOptions, out: &mut W) -> Result<DemoSummary
516516
})
517517
}
518518

519-
fn spawn_mock_http(
520-
stop: Arc<AtomicBool>,
521-
handler: Arc<dyn Fn(&str, &str) -> (u16, String) + Send + Sync>,
522-
) -> Result<SocketAddr, String> {
519+
type MockHttpHandler = Arc<dyn Fn(&str, &str) -> (u16, String) + Send + Sync>;
520+
521+
fn spawn_mock_http(stop: Arc<AtomicBool>, handler: MockHttpHandler) -> Result<SocketAddr, String> {
523522
let listener = TcpListener::bind("127.0.0.1:0").map_err(|e| format!("bind mock http: {e}"))?;
524523
let addr = listener
525524
.local_addr()

‎src/main.rs‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,7 @@ fn main() {
230230

231231
fn is_loopback_addr(addr: &str) -> bool {
232232
addr.parse::<SocketAddr>()
233-
.map(|sa| sa.ip().is_loopback())
234-
.unwrap_or(false)
233+
.is_ok_and(|sa| sa.ip().is_loopback())
235234
}
236235

237236
fn resolve_admin_token() -> (String, bool) {

‎src/store.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ impl SessionStore {
489489
.values()
490490
.filter(|s| now.signed_duration_since(s.last_seen) <= g.session_ttl)
491491
.collect();
492-
active_refs.sort_by(|a, b| b.last_seen.cmp(&a.last_seen));
492+
active_refs.sort_by_key(|a| std::cmp::Reverse(a.last_seen));
493493

494494
let mut metrics = g.metrics.clone();
495495
metrics.active_sessions = active_refs.len();

0 commit comments

Comments
 (0)