From 280ec7216829b21b09b37b1c783562bc4e0d7270 Mon Sep 17 00:00:00 2001 From: argszero Date: Thu, 13 Aug 2026 18:33:56 +0800 Subject: [PATCH 1/3] =?UTF-8?q?docs:=20=E6=B7=BB=E5=8A=A0=20MIT=20LICENSE?= =?UTF-8?q?=20=E6=96=87=E4=BB=B6=EF=BC=88=E4=B8=8E=20README/Cargo.toml=20?= =?UTF-8?q?=E5=A3=B0=E6=98=8E=E4=B8=80=E8=87=B4=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LICENSE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..e2c8829 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 argszero + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. From bc962d76c23d2664c600339a8021233f1418af3b Mon Sep 17 00:00:00 2001 From: argszero Date: Thu, 13 Aug 2026 18:41:47 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fix:=20=E6=B6=88=E9=99=A4=20banner()=20?= =?UTF-8?q?=E4=B8=AD=E6=97=A0=E5=8F=82=20format!=20=E7=9A=84=20clippy=20?= =?UTF-8?q?=E8=AD=A6=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit format! 无格式化参数时 clippy 报 useless-format,改为字符串字面量 + to_string()。 --- src/main.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main.rs b/src/main.rs index 0fb851a..7b8ff13 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,12 +7,11 @@ /// 返回项目横幅文本(便于测试与展示) pub fn banner() -> String { - format!( - "AITokenPool — AI Token 共享池\n\ - 企业版:key 池 + 员工点数配额 · 公共版:共享市场\n\ - 架构:中心化(方案 A),Rust + axum\n\ - 状态:项目初始化中(2026-08-13)" - ) + "AITokenPool — AI Token 共享池\n\ + 企业版:key 池 + 员工点数配额 · 公共版:共享市场\n\ + 架构:中心化(方案 A),Rust + axum\n\ + 状态:项目初始化中(2026-08-13)" + .to_string() } fn main() { From 8027498fb6772e92d12eb91eb1b1d15364009976 Mon Sep 17 00:00:00 2001 From: argszero Date: Thu, 13 Aug 2026 18:41:47 +0800 Subject: [PATCH 3/3] =?UTF-8?q?chore(ci):=20=E6=B7=BB=E5=8A=A0=20GitHub=20?= =?UTF-8?q?Actions=20workflow=EF=BC=88cargo=20test=20+=20fmt=20+=20clippy?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit push 到 main 与 PR 时运行:cargo fmt --check、cargo clippy --all-targets -- -D warnings、cargo test。rust-toolchain@stable + rust-cache 加速构建。 --- .github/workflows/ci.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..534f6cf --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,33 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + +env: + CARGO_TERM_COLOR: always + +jobs: + ci: + name: test / fmt / clippy + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + with: + components: rustfmt, clippy + + - name: Cache cargo build artifacts + uses: Swatinem/rust-cache@v2 + + - name: Check formatting + run: cargo fmt --check + + - name: Run clippy + run: cargo clippy --all-targets -- -D warnings + + - name: Run tests + run: cargo test