Cocos 执行错误去掉多余的 to_string

- cocos_execute/error.rs CodeInvalid 直接 clone 已拥有的 cause
This commit is contained in:
2026-10-02 14:40:19 +08:00
parent 8f07ff9379
commit dd115778e9
@@ -66,7 +66,7 @@ impl ToolFailure for CocosExecuteError {
format!("Cocos 参数无效:{cause}")
}
Self::CodeNotText => "code 必须是 JavaScript 函数体。".to_string(),
Self::CodeInvalid { cause } => cause.to_string(),
Self::CodeInvalid { cause } => cause.clone(),
Self::ExecutionBusy => {
"已有 Cocos 操作执行中,请等待回执;本次调用没有发送执行命令,也不要重放。"
.to_string()