Skip to content

Commit f52308c

Browse files
authored
Conform String to Additive (#164)
1 parent c48ab68 commit f52308c

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

Sources/Algebra/AlgebraAdapters.swift

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,15 @@ extension Array: Additive {
6565
// MARK: - Additive
6666

6767
/// - Returns: An `Array` with no elements.
68-
public static var zero: Array {
69-
return Array()
70-
}
68+
public static var zero: Array { return [] }
69+
}
70+
71+
extension String: Additive {
72+
73+
// MARK: - Additive
74+
75+
/// - Returns: An `String` with no characters.
76+
public static var zero: String { return "" }
7177
}
7278

7379
extension Set: Additive {

0 commit comments

Comments
 (0)