From 2b86552d3ee60a23674ac2235dd30d132bafcfcc Mon Sep 17 00:00:00 2001 From: wunianxiao Date: Wed, 17 Jun 2026 16:04:17 +0800 Subject: [PATCH] =?UTF-8?q?perf(qrcode):=20=E5=85=B3=E9=97=AD=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=20features=EF=BC=8C=E7=A7=BB=E9=99=A4=20image=20?= =?UTF-8?q?=E4=BE=9D=E8=B5=96=E9=93=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit qrcode 默认启用了 image/svg/pic,但项目只使用 Unicode 终端渲染, 不需要图片编解码。关闭后移除 image 及其子依赖。 --- Cargo.lock | 43 ------------------------------------------- Cargo.toml | 2 +- 2 files changed, 1 insertion(+), 44 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 73dd1fe..e8544b3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -150,24 +150,12 @@ version = "3.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649" -[[package]] -name = "bytemuck" -version = "1.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8efb64bd706a16a1bdde310ae86b351e4d21550d98d056f22f8a7f7a2183fec" - [[package]] name = "byteorder" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" -[[package]] -name = "byteorder-lite" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" - [[package]] name = "bytes" version = "1.11.1" @@ -1084,18 +1072,6 @@ dependencies = [ "icu_properties", ] -[[package]] -name = "image" -version = "0.25.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85ab80394333c02fe689eaf900ab500fbd0c2213da414687ebf995a65d5a6104" -dependencies = [ - "bytemuck", - "byteorder-lite", - "moxcms", - "num-traits", -] - [[package]] name = "indexmap" version = "2.14.0" @@ -1260,16 +1236,6 @@ dependencies = [ "windows-sys 0.61.2", ] -[[package]] -name = "moxcms" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb85c154ba489f01b25c0d36ae69a87e4a1c73a72631fc6c0eb6dde34a73e44b" -dependencies = [ - "num-traits", - "pxfm", -] - [[package]] name = "new_debug_unreachable" version = "1.0.6" @@ -1540,20 +1506,11 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "pxfm" -version = "0.1.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0c5ccf5294c6ccd63a74f1565028353830a9c2f5eb0c682c355c471726a6e3f" - [[package]] name = "qrcode" version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d68782463e408eb1e668cf6152704bd856c78c5b6417adaee3203d8f4c1fc9ec" -dependencies = [ - "image", -] [[package]] name = "quinn" diff --git a/Cargo.toml b/Cargo.toml index 02847cb..59c6b80 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,7 +31,7 @@ tracing = "0.1" # 结构化日志 tracing-subscriber = { version = "0.3", features = ["env-filter"] } # 日志输出 tracing-appender = "0.2.5" # 文件日志(日滚) # ── 二维码 ── -qrcode = "0.14" # 二维码生成 +qrcode = { version = "0.14", default-features = false } # 二维码生成(仅 Unicode 终端渲染) # ── 异步 trait ── async-trait = "0.1" # 异步 trait 支持 # ── 流式处理 ──