From 806480adb199dbfa1ce2d7bc3a801e575c3b8adf Mon Sep 17 00:00:00 2001 From: matresnan <1358168412@qq.com> Date: Thu, 21 Aug 2025 11:28:50 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E6=9B=B4=E6=96=B0README=E6=96=87?= =?UTF-8?q?=E6=A1=A3=E5=B9=B6=E6=94=B9=E8=BF=9B=E9=94=99=E8=AF=AF=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在README.md文件中添加获取项目列表的API接口文档说明。 - 将服务启动代码中的错误处理从 `unwrap()` 改为更安全的 `?` 操作符以传播错误。 --- README.md | 3 ++- src/main.rs | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 617a1d2..a3c5c33 100644 --- a/README.md +++ b/README.md @@ -6,4 +6,5 @@ | /verify | 验证token有效性 | token | | /info | 查询token信息 | token | | /reset | 更新token状态 | token、enable | -| /renewal | token续期 | token、days | \ No newline at end of file +| /renewal | token续期 | token、days | +| /project | 获取项目列表 | | diff --git a/src/main.rs b/src/main.rs index e3dc003..9d1d406 100644 --- a/src/main.rs +++ b/src/main.rs @@ -38,8 +38,8 @@ async fn main() -> Result<(), Box> { .route("/project", get(get_projects)) .with_state(state); - let listener = tokio::net::TcpListener::bind("0.0.0.0:3009").await.unwrap(); - axum::serve(listener, app).await.unwrap(); + let listener = tokio::net::TcpListener::bind("0.0.0.0:3009").await?; + axum::serve(listener, app).await?; Ok(()) }