-
-
Save laevandus/3f50ce122fa47a08d85cfc22535da579 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Entry: ExpressibleByStringInterpolation { | |
// typealias StringInterpolation = EntryInterpolation | |
private(set) var value: String | |
init(stringLiteral value: String) { | |
self.value = value | |
} | |
init(stringInterpolation: EntryInterpolation) { | |
self.value = stringInterpolation.values.joined() | |
} | |
} | |
struct EntryInterpolation: StringInterpolationProtocol { | |
private(set) var values: [String] | |
init(literalCapacity: Int, interpolationCount: Int) { | |
self.values = [] | |
} | |
mutating func appendLiteral(_ literal: StringLiteralType) { | |
values.append(literal) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment