warning: use of deprecated associated function `std::error::Error::description`: use the Display impl or to_string()
error::Error::description(self)
这是否证明了整个Display impl
样板的合理性,或者我可以放弃更简单的to_string()
。description
中的哪些内容现在已被弃用(由于其简单性,我将非常怀念(?
添加Display实现;现在,错误就是这样发生的。
您可以使用thiserror
派生宏库为您生成一个样板,并使用注释错误类型的字符串来最小化样板。