From e7e795dd7232f48715f4d06dc59bc0ea723ffe8c Mon Sep 17 00:00:00 2001 From: ForgQi <34411314+ForgQi@users.noreply.github.com> Date: Fri, 26 Sep 2025 02:13:31 +0800 Subject: [PATCH] Replace typed-builder with bon and update builder usage Replaced the 'typed-builder' crate with 'bon' across the project, updating all builder pattern usages to match the new derive macros and method names. Adjusted struct derives and builder method calls in uploader and upload logic to use 'bon::Builder' and the new 'maybe_' method conventions. Updated dependencies in Cargo.toml files accordingly and removed 'typed-builder' from the workspace. --- Cargo.lock | 23 +------------------ Cargo.toml | 1 - crates/biliup-cli/src/server/common/upload.rs | 8 +++---- crates/biliup/Cargo.toml | 2 +- crates/biliup/src/uploader/bilibili.rs | 16 +++++++------ crates/stream-gears/Cargo.toml | 1 - crates/stream-gears/src/lib.rs | 6 ++--- crates/stream-gears/src/uploader.rs | 11 ++++----- 8 files changed, 23 insertions(+), 45 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8d8b1fe..178cfbd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -361,6 +361,7 @@ version = "0.2.4" dependencies = [ "async-trait", "base64", + "bon", "byteorder", "bytes", "chrono", @@ -386,7 +387,6 @@ dependencies = [ "tokio", "tracing", "tracing-subscriber", - "typed-builder", "url", ] @@ -3661,7 +3661,6 @@ dependencies = [ "tracing", "tracing-appender", "tracing-subscriber", - "typed-builder", "url", ] @@ -4224,26 +4223,6 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" -[[package]] -name = "typed-builder" -version = "0.20.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd9d30e3a08026c78f246b173243cf07b3696d274debd26680773b6773c2afc7" -dependencies = [ - "typed-builder-macro", -] - -[[package]] -name = "typed-builder-macro" -version = "0.20.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c36781cc0e46a83726d9879608e4cf6c2505237e263a8eb8c24502989cfdb28" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "typenum" version = "1.18.0" diff --git a/Cargo.toml b/Cargo.toml index c32abac..0820085 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,7 +29,6 @@ error-stack = "0.6.0" time = { version = "0.3", features = ["serde"] } chrono = { version = "0.4", features = ["serde"] } -typed-builder = "0.20.0" bon = "3.7.2" regex = "1.11.1" reqwest = { version = "0.12", default-features = false } diff --git a/crates/biliup-cli/src/server/common/upload.rs b/crates/biliup-cli/src/server/common/upload.rs index fa86ae0..b216561 100644 --- a/crates/biliup-cli/src/server/common/upload.rs +++ b/crates/biliup-cli/src/server/common/upload.rs @@ -215,13 +215,13 @@ async fn build_studio(context: &UploadContext, videos: Vec