金庆的专栏

  C++博客 :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  423 随笔 :: 0 文章 :: 454 评论 :: 0 Trackbacks

Error Return Check Policy

  • Never use unwrap on Result. If the type is Err, it will panic and crash the program. The only exception is if it has already been checked for error previously or in test code.
  • Never use unwrap on Option for the same reason if the type is None as Result is Err.
posted on 2021-08-09 17:08 金庆 阅读(214) 评论(0)  编辑 收藏 引用 所属分类: 9. 其它