使用?操作符无法格式化错误消息
示例代码: use std::fmt; #[derive(Debug)] struct AppError { kind: String, message: String, } impl std::error::Error for AppError {} impl fmt::Display for AppError { fn fmt(&self, f: &mut...
示例代码: use std::fmt; #[derive(Debug)] struct AppError { kind: String, message: String, } impl std::error::Error for AppError {} impl fmt::Display for AppError { fn fmt(&self, f: &mut...