diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a3853ef..52c632f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: timeout-minutes: 15 strategy: matrix: - image: ["swift:5.9", "swift:5.10", "swiftlang/swift:nightly-6.0-jammy"] + image: ["swift:5.8", "swift:5.9", "swift:5.10", "swiftlang/swift:nightly-6.0-jammy"] container: image: ${{ matrix.image }} diff --git a/.swiftformat b/.swiftformat index 14fb33f..67acb74 100644 --- a/.swiftformat +++ b/.swiftformat @@ -2,7 +2,7 @@ --minversion 0.53.10 # Swift version ---swiftversion 5.9 +--swiftversion 5.8 # file options --exclude .build diff --git a/Sources/Mustache/Context.swift b/Sources/Mustache/Context.swift index 03488a9..21fe557 100644 --- a/Sources/Mustache/Context.swift +++ b/Sources/Mustache/Context.swift @@ -68,19 +68,21 @@ struct MustacheContext { /// return context with indent and parameter information for invoking a partial func withPartial(indented: String?, inheriting: [String: MustacheTemplate]?) -> MustacheContext { - let indentation: String? = if let indented { - (self.indentation ?? "") + indented + let indentation: String? + if let indented { + indentation = (self.indentation ?? "") + indented } else { - self.indentation + indentation = self.indentation } - let inherits: [String: MustacheTemplate]? = if let inheriting { + let inherits: [String: MustacheTemplate]? + if let inheriting { if let originalInherits = self.inherited { - originalInherits.merging(inheriting) { value, _ in value } + inherits = originalInherits.merging(inheriting) { value, _ in value } } else { - inheriting + inherits = inheriting } } else { - self.inherited + inherits = self.inherited } return .init( stack: self.stack, @@ -95,10 +97,11 @@ struct MustacheContext { /// return context with indent information for invoking an inheritance block func withBlockExpansion(indented: String?) -> MustacheContext { - let indentation: String? = if let indented { - (self.indentation ?? "") + indented + let indentation: String? + if let indented { + indentation = (self.indentation ?? "") + indented } else { - self.indentation + indentation = self.indentation } return .init( stack: self.stack,