RunFailure Display 去掉多余的一次 String 分配
- codex_app_server/mod.rs:Self::Failed(error) 用 write!(formatter, "{error}") 直接走 Display,不再先 error.to_string() 再 write_str
This commit is contained in:
@@ -4262,7 +4262,7 @@ impl TerminalContext {
|
||||
impl std::fmt::Display for RunFailure {
|
||||
fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
Self::Failed(error) => formatter.write_str(&error.to_string()),
|
||||
Self::Failed(error) => write!(formatter, "{error}"),
|
||||
Self::RepairRequired { detail } => formatter.write_str(detail),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user