Make MustacheSequence public (#38)

* Make `MustacheSequence` public

* `MustacheSequence` require conformance to `Sequence`

* remove protocol requirements

* `MustacheContext` revert to `internal`
This commit is contained in:
Mahdi Bahrami
2024-07-14 21:14:59 +03:30
committed by GitHub
parent a1a163bad1
commit cc0eaffa06
2 changed files with 4 additions and 9 deletions

View File

@@ -13,14 +13,9 @@
//===----------------------------------------------------------------------===//
/// Protocol for objects that can be rendered as a sequence in Mustache
protocol MustacheSequence {
/// Render section using template
func renderSection(with template: MustacheTemplate, context: MustacheContext) -> String
/// Render inverted section using template
func renderInvertedSection(with template: MustacheTemplate, context: MustacheContext) -> String
}
public protocol MustacheSequence: Sequence {}
extension Sequence {
extension MustacheSequence {
/// Render section using template
func renderSection(with template: MustacheTemplate, context: MustacheContext) -> String {
var string = ""