From 433a15c7c1eb49ebd77f0c29ba792546c1c1a732 Mon Sep 17 00:00:00 2001 From: Zheng Ping Date: Mon, 19 Jun 2017 23:18:14 +0800 Subject: [PATCH] Update ch18-02-refutability.md --- src/ch18-02-refutability.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/ch18-02-refutability.md b/src/ch18-02-refutability.md index f71b776..efd9a53 100644 --- a/src/ch18-02-refutability.md +++ b/src/ch18-02-refutability.md @@ -1,8 +1,6 @@ -## Refutability: Whether a Pattern Might Fail to Match +## Refutability(可反驳性): 模式是否会匹配失效 -Patterns come in two forms: refutable and irrefutable. Patterns which cannot -fail to match for any possible value are said to be *irrefutable*, and patterns -which can fail to match for some possible value are said to be *refutable*. +模式有两种形式: refutable(可反驳)和irrefutable(不可反驳). 对任意可能的值进行匹配都不会失效的模式被称为是*irrefutable*(不可反驳)的, 而对某些可能的值进行匹配会失效的模式被称为是*refutable*(可反驳)的. `let` statements, function parameters, and `for` loops are restricted to only accept irrefutable patterns, since there's nothing correct the program could do if the pattern fails to match. `if let`, and `while let` expressions are