mirror of
https://github.com/Yuyi-Oak/BlueArchiveToolkit.git
synced 2026-07-21 22:11:26 +08:00
fix(official-sync): 修复阻塞 clippy 门禁的两处告警
cargo clippy --workspace -- -D warnings 在 HEAD 上失败,阻塞项目验证门禁:
- resolve_bootstrap 因 c123f6c 新增 curl_proxy 参数达到 8 个,触发
too_many_arguments。将 curl_command/curl_proxy/unzip_command 收拢为
BootstrapTools 结构体,降到 6 个参数。
- visible_historical_failed_versions(169822a 引入)的显式生命周期可省略,
触发 needless_lifetimes。按 clippy 建议省略。
对应 issue #18 维护清单 1-7。
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -2024,9 +2024,9 @@ fn print_daemon_version_state_summary(version_state: &OfficialVersionState) {
|
||||
}
|
||||
}
|
||||
|
||||
fn visible_historical_failed_versions<'a>(
|
||||
version_state: &'a OfficialVersionState,
|
||||
) -> Vec<&'a OfficialFailedVersionRecord> {
|
||||
fn visible_historical_failed_versions(
|
||||
version_state: &OfficialVersionState,
|
||||
) -> Vec<&OfficialFailedVersionRecord> {
|
||||
let in_progress = version_state.in_progress_version.as_ref();
|
||||
version_state
|
||||
.failed_versions
|
||||
|
||||
@@ -911,9 +911,11 @@ impl OfficialUpdateService {
|
||||
));
|
||||
Some(resolve_bootstrap(
|
||||
&config.launcher_version,
|
||||
&config.curl_command,
|
||||
&config.curl_proxy,
|
||||
&config.unzip_command,
|
||||
&BootstrapTools {
|
||||
curl_command: &config.curl_command,
|
||||
curl_proxy: &config.curl_proxy,
|
||||
unzip_command: &config.unzip_command,
|
||||
},
|
||||
&bootstrap_cache_path,
|
||||
!config.dry_run,
|
||||
&mut progress,
|
||||
@@ -2364,11 +2366,16 @@ fn game_main_config_snapshot(config: &YostarJpGameMainConfig) -> GameMainConfigS
|
||||
}
|
||||
}
|
||||
|
||||
/// 官方引导链路使用的外部命令与代理配置。
|
||||
struct BootstrapTools<'a> {
|
||||
curl_command: &'a Path,
|
||||
curl_proxy: &'a CurlProxyConfig,
|
||||
unzip_command: &'a Path,
|
||||
}
|
||||
|
||||
fn resolve_bootstrap(
|
||||
launcher_version: &str,
|
||||
curl_command: &Path,
|
||||
curl_proxy: &CurlProxyConfig,
|
||||
unzip_command: &Path,
|
||||
tools: &BootstrapTools<'_>,
|
||||
cache_path: &Path,
|
||||
write_cache: bool,
|
||||
progress: &mut dyn FnMut(OfficialUpdateProgress),
|
||||
@@ -2377,9 +2384,9 @@ fn resolve_bootstrap(
|
||||
check_shutdown_requested(should_cancel)?;
|
||||
let launcher = OfficialLauncherBootstrapService::with_curl_command(
|
||||
launcher_version,
|
||||
curl_command.to_string_lossy().to_string(),
|
||||
tools.curl_command.to_string_lossy().to_string(),
|
||||
)
|
||||
.with_proxy_config(curl_proxy.clone());
|
||||
.with_proxy_config(tools.curl_proxy.clone());
|
||||
progress(OfficialUpdateProgress::new(
|
||||
"launcher",
|
||||
"正在拉取官方启动器游戏配置和远端 manifest",
|
||||
@@ -2425,10 +2432,10 @@ fn resolve_bootstrap(
|
||||
check_shutdown_requested(should_cancel)?;
|
||||
let bootstrapper = OfficialGameMainConfigBootstrapService::with_commands(
|
||||
launcher_version,
|
||||
curl_command.to_path_buf(),
|
||||
unzip_command.to_path_buf(),
|
||||
tools.curl_command.to_path_buf(),
|
||||
tools.unzip_command.to_path_buf(),
|
||||
)
|
||||
.with_proxy_config(curl_proxy.clone());
|
||||
.with_proxy_config(tools.curl_proxy.clone());
|
||||
let bootstrap = bootstrapper.fetch_bootstrap().map_err(anyhow::Error::msg)?;
|
||||
check_shutdown_requested(should_cancel)?;
|
||||
let launcher_metadata = LauncherMetadataSnapshot {
|
||||
|
||||
Reference in New Issue
Block a user