Skip to content

Commit d2f9eaa

Browse files
authored
Conform Stack to CustomStringConvertible (#213)
1 parent 7503185 commit d2f9eaa

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Sources/DataStructures/Stack.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,16 @@ extension Stack: ExpressibleByArrayLiteral {
134134
}
135135
}
136136

137+
extension Stack: CustomStringConvertible {
138+
139+
// MARK: - CustomStringConvertible
140+
141+
/// - Returns: The printed description of this `Stack`.
142+
public var description: String {
143+
return elements.description
144+
}
145+
}
146+
137147
extension Stack: Additive {
138148

139149
// MARK: - Additive

0 commit comments

Comments
 (0)