Skip to content

Commit 6586f97

Browse files
committed
Apply Clippy suggestions
1 parent 0c21c14 commit 6586f97

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

ui/src/gist.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ impl From<octocrab::models::gists::Gist> for Gist {
2323
0 | 1 => files.into_iter().map(|(_, content)| content).collect(),
2424
_ => files
2525
.into_iter()
26-
.map(|(name, content)| format!("// {}\n{}\n\n", name, content))
26+
.map(|(name, content)| format!("// {name}\n{content}\n\n"))
2727
.collect(),
2828
};
2929

ui/src/server_axum.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ pub(crate) async fn serve(config: Config) {
162162

163163
app = app.layer(SetRequestIdLayer::new(
164164
x_request_id.clone(),
165-
MakeRequestUuid::default(),
165+
MakeRequestUuid,
166166
));
167167

168168
let server_socket_addr = config.server_socket_addr();
@@ -525,9 +525,8 @@ where
525525
.with_max_age(SANDBOX_CACHE_TIME_TO_LIVE)
526526
.with_public();
527527

528-
let use_fresh = if_none_match.map_or(true, |if_none_match| {
529-
if_none_match.0.precondition_passes(&etag)
530-
});
528+
let use_fresh =
529+
if_none_match.is_none_or(|if_none_match| if_none_match.0.precondition_passes(&etag));
531530

532531
let etag = TypedHeader(etag);
533532
let cache_control = TypedHeader(cache_control);
@@ -617,7 +616,7 @@ async fn nowebsocket(Json(req): Json<NoWebSocketRequest>) {
617616
}
618617

619618
static WS_ERRORS: LazyLock<std::sync::Mutex<std::collections::HashMap<String, usize>>> =
620-
LazyLock::new(|| Default::default());
619+
LazyLock::new(Default::default);
621620

622621
fn record_websocket_error(error: String) {
623622
*WS_ERRORS

ui/src/server_axum/websocket.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ pub(crate) async fn handle(
212212
let start = Instant::now();
213213

214214
let id = WEBSOCKET_ID.fetch_add(1, Ordering::SeqCst);
215-
tracing::Span::current().record("ws_id", &id);
215+
tracing::Span::current().record("ws_id", id);
216216
info!("WebSocket started");
217217

218218
handle_core(socket, config, factory, feature_flags, db).await;
@@ -440,7 +440,7 @@ async fn handle_core(
440440
_ = active_execution_gc_interval.tick() => {
441441
active_executions = mem::take(&mut active_executions)
442442
.into_iter()
443-
.filter(|(_id, (_, tx))| tx.as_ref().map_or(false, |tx| !tx.is_closed()))
443+
.filter(|(_id, (_, tx))| tx.as_ref().is_some_and(|tx| !tx.is_closed()))
444444
.collect();
445445
},
446446

0 commit comments

Comments
 (0)