E0088#
警告名称:guard_redundant_bang
guard! 的条件或模式是穷尽的,因此不可能失败,无需使用显式终止形式。
错误示例#
///|
pub fn identity(value : Int) -> Int {
guard! value is result
result
}
修改建议#
将 guard! 替换为 guard。
///|
pub fn identity(value : Int) -> Int {
guard value is result
result
}