advance/errors #766
Replies: 10 comments 20 replies
-
关于如何选用 thiserror 和 anyhow 只需要遵循一个原则即可:是否关注自定义错误消息,关注则使用 thiserror(常见业务代码),否则使用 anyhow(编写第三方库代码)。 这个位置是写错了吗,还是说我理解有误。 |
Beta Was this translation helpful? Give feedback.
-
#[derive(thiserror::Error, Debug)] 我不信强迫症内心毫无波澜 |
Beta Was this translation helpful? Give feedback.
-
对于返回的Result, 看到返回值有时候写作 |
Beta Was this translation helpful? Give feedback.
-
个人对这一段代码的理解: 采用短路求值的理解方式. 下面用
前面两个都是 后面两个是类似的, 然后
前两个 是 后面两个是 |
Beta Was this translation helpful? Give feedback.
-
晕了,这是什么。。 |
Beta Was this translation helpful? Give feedback.
-
为什么不讲一下anyhow得with_context,这样可以很快简化代码(建议) |
Beta Was this translation helpful? Give feedback.
-
为什么,这段代码在
他会报String没有实现Read特征
|
Beta Was this translation helpful? Give feedback.
-
使用 |
Beta Was this translation helpful? Give feedback.
-
归一化使用特征对象那一节中:
啊? 特征对象不就是接收实现了同个特征的对象而存在的吗,类似多态,不实现 |
Beta Was this translation helpful? Give feedback.
-
advance/errors
https://course.rs/advance/errors.html
Beta Was this translation helpful? Give feedback.
All reactions