// *** 以前 ***
// 过去添加字段或变体会让该 crate 的每个使用者构建失败,
// 所以枚举里被放进了一个隐藏的占位变体
pub enum Error {
NotFound,
Timeout,
#[doc(hidden)]
__Nonexhaustive,
}
// *** 在 1.40 版本中 ***
#[non_exhaustive]
pub enum Error {
NotFound,
Timeout,
}
// 在 crate 之外,对这类枚举的 match 必须有 _ 分支