Skip to content

Commit

Permalink
Fixes for swift 5.8
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-fowler committed Jul 19, 2024
1 parent 5bb66ac commit aadf47b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .swiftformat
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
--minversion 0.53.10

# Swift version
--swiftversion 5.9
--swiftversion 5.8

# file options
--exclude .build
Expand Down
16 changes: 9 additions & 7 deletions Sources/Mustache/Context.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit aadf47b

Please sign in to comment.