3D 产物读取不再克隆 content type
- server-rs/crates/api-server/src/tripo3d/artifacts.rs:content_type 只在本函数取一次、之后不再读句柄字段,改用 take() 转移所有权而不是 clone() 验证:cargo check -p api-server(--locked)
This commit is contained in:
@@ -24,7 +24,7 @@ pub(crate) struct DownloadedArtifact {
|
||||
pub(crate) async fn read_artifact(
|
||||
mut artifact: TripoDownloadedArtifact,
|
||||
) -> Result<DownloadedArtifact, AppError> {
|
||||
let content_type = artifact.content_type.clone().unwrap_or_default();
|
||||
let content_type = artifact.content_type.take().unwrap_or_default();
|
||||
// 按声明长度预分配(封顶到单产物上限,防止 provider 谎报长度撑爆内存):
|
||||
// 几百 MB 的模型逐块 append 会反复搬移,预分配把峰值与拷贝都压下来。
|
||||
let claimed_bytes = artifact
|
||||
|
||||
Reference in New Issue
Block a user