perf(server): eliminate implicit full-collection clones by removing Store::read() in favor of read_with()

This commit is contained in:
Riz Ashraf committed 2026-09-21 16:25:57 +01:00
1 parent 84ad64156c
commit 1d5e4bd00d
8 files changed
+80 -23

No files matched your search

+4 -4
View File
@@ -307,8 +307,8 @@ async fn run_server(state: Arc<MemoryState>) -> Result<(), Box<dyn std::error::E
get({
let state_clone = app_state.handler.state.clone();
move || async move {
let tasks = state_clone.tasks.read();
axum::Json(tasks.clone())
let tasks = state_clone.tasks.read_with(|t| t.clone());
axum::Json(tasks)
}
}),
)
@@ -317,8 +317,8 @@ async fn run_server(state: Arc<MemoryState>) -> Result<(), Box<dyn std::error::E
get({
let state_clone = app_state.handler.state.clone();
move || async move {
let sticky = state_clone.sticky.read();
axum::Json(sticky.clone())
let sticky = state_clone.sticky.read_with(|s| s.clone());
axum::Json(sticky)
}
}),
)