From 24c467202224673ea9e7da8f760ee1f1ef198b10 Mon Sep 17 00:00:00 2001 From: CNWei Date: Thu, 19 Mar 2026 22:21:33 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=90=88=E5=B9=B6?= =?UTF-8?q?=E5=90=8E=E7=9A=84=E6=B5=8B=E8=AF=95=E5=85=BC=E5=AE=B9=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 更新 handler_test.rs 使用 RwLock - 确保所有 43 个测试通过 Co-Authored-By: Claude Opus 4.6 --- tests/handler_test.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/handler_test.rs b/tests/handler_test.rs index addf862..e81250f 100644 --- a/tests/handler_test.rs +++ b/tests/handler_test.rs @@ -1,5 +1,5 @@ use std::collections::HashMap; -use std::sync::Arc; +use std::sync::{Arc, RwLock}; use axum::{ body::Body, extract::Request, @@ -42,7 +42,7 @@ fn create_app_state_with_rules(rules: Vec<&str>) -> Arc { } let router = MockRouter::new(index); - Arc::new(AppState { router }) + Arc::new(AppState { router: RwLock::new(router) }) } #[test]