style: apply rustfmt after master merge

This commit is contained in:
2026-05-14 19:17:40 +08:00
parent 502811a103
commit e55c12b68b
2 changed files with 22 additions and 18 deletions

View File

@@ -3614,9 +3614,8 @@ async fn ensure_match3d_background_music_asset(
));
};
let title = require_match3d_background_music_title(plan).map_err(|error| {
match3d_error_response(request_context, MATCH3D_AGENT_PROVIDER, error)
})?;
let title = require_match3d_background_music_title(plan)
.map_err(|error| match3d_error_response(request_context, MATCH3D_AGENT_PROVIDER, error))?;
let style = normalize_match3d_audio_style(plan.style.as_str());
match generate_match3d_background_music_asset(state, owner_user_id, profile_id, &title, &style)
.await
@@ -6556,12 +6555,13 @@ mod tests {
#[test]
fn match3d_background_music_title_is_required_for_auto_draft() {
let missing = require_match3d_background_music_title(&Match3DGeneratedBackgroundMusicPlan {
title: " ,。 ".to_string(),
style: "轻快, 休闲".to_string(),
prompt: String::new(),
})
.expect_err("自动草稿背景音乐必须有可提交给 Suno 的曲名");
let missing =
require_match3d_background_music_title(&Match3DGeneratedBackgroundMusicPlan {
title: " ,。 ".to_string(),
style: "轻快, 休闲".to_string(),
prompt: String::new(),
})
.expect_err("自动草稿背景音乐必须有可提交给 Suno 的曲名");
assert!(missing.body_text().contains("背景音乐"));

View File

@@ -3444,10 +3444,12 @@ async fn generate_puzzle_background_music_required(
) -> Result<CreationAudioAsset, AppError> {
let normalized_title = title.trim();
if normalized_title.is_empty() {
return Err(AppError::from_status(StatusCode::BAD_GATEWAY).with_details(json!({
"provider": PUZZLE_AGENT_API_BASE_PROVIDER,
"message": "拼图草稿背景音乐名称为空,无法完成背景音乐生成",
})));
return Err(
AppError::from_status(StatusCode::BAD_GATEWAY).with_details(json!({
"provider": PUZZLE_AGENT_API_BASE_PROVIDER,
"message": "拼图草稿背景音乐名称为空,无法完成背景音乐生成",
})),
);
}
generate_background_music_asset_for_creation(
state,
@@ -3517,11 +3519,13 @@ fn ensure_puzzle_initial_level_assets_ready(
missing.push("UI背景图");
}
Err(AppError::from_status(StatusCode::BAD_GATEWAY).with_details(json!({
"provider": PUZZLE_AGENT_API_BASE_PROVIDER,
"message": format!("拼图草稿资源生成未完成:缺少{}", missing.join("")),
"missingAssets": missing,
})))
Err(
AppError::from_status(StatusCode::BAD_GATEWAY).with_details(json!({
"provider": PUZZLE_AGENT_API_BASE_PROVIDER,
"message": format!("拼图草稿资源生成未完成:缺少{}", missing.join("")),
"missingAssets": missing,
})),
)
}
fn find_puzzle_level_for_initial_asset_check<'a>(