From 02e0b33fd633b592259509fc15337d9211a5f9c6 Mon Sep 17 00:00:00 2001 From: Johnson <32932766+johnsongs@users.noreply.github.com> Date: Thu, 8 Aug 2019 21:55:03 +0800 Subject: [PATCH] Update 21_Protocols.md (#976) --- source/chapter2/21_Protocols.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/chapter2/21_Protocols.md b/source/chapter2/21_Protocols.md index 5e433eb1..db4e1f79 100644 --- a/source/chapter2/21_Protocols.md +++ b/source/chapter2/21_Protocols.md @@ -883,7 +883,7 @@ extension PrettyTextRepresentable { 在扩展协议的时候,可以指定一些限制条件,只有遵循协议的类型满足这些限制条件时,才能获得协议扩展提供的默认实现。这些限制条件写在协议名之后,使用 `where` 子句来描述,正如 [泛型 Where 子句](./22_Generics.md#where_clauses) 中所描述的。 -例如,你可以扩展 `Collection` 协议,适用于集合中的元素遵循了 `Equatable` 协议的情况。通过限制集合元素遵 `Equatable` 协议, 作为标准库的一部分, 你可以使用 `==` 和 `!=` 操作符来检查两个元素的等价性和非等价性。 +例如,你可以扩展 `Collection` 协议,适用于集合中的元素遵循了 `Equatable` 协议的情况。通过限制集合元素遵循 `Equatable` 协议, 作为标准库的一部分, 你可以使用 `==` 和 `!=` 操作符来检查两个元素的等价性和非等价性。 ```swift extension Collection where Element: Equatable {