Fully upgrading to Swift 4.1.1
`flatMap()` -> `compactMap()`
This commit is contained in:
parent
94123e4974
commit
0349fd1d62
|
@ -67,3 +67,6 @@ fastlane/test_output
|
|||
Packages/
|
||||
*.xcodeproj/
|
||||
.DS_Store
|
||||
|
||||
*.resolved
|
||||
*.pins
|
|
@ -1,3 +1,4 @@
|
|||
// swift-tools-version:4.0
|
||||
//
|
||||
// Package.swift
|
||||
// PerfectMustache
|
||||
|
@ -9,7 +10,7 @@
|
|||
//
|
||||
// This source file is part of the Perfect.org open source project
|
||||
//
|
||||
// Copyright (c) 2015 - 2016 PerfectlySoft Inc. and the Perfect project authors
|
||||
// Copyright (c) 2015 - 2018 PerfectlySoft Inc. and the Perfect project authors
|
||||
// Licensed under Apache License v2.0
|
||||
//
|
||||
// See http://perfect.org/licensing.html for license information
|
||||
|
@ -18,10 +19,16 @@
|
|||
//
|
||||
|
||||
import PackageDescription
|
||||
|
||||
let package = Package(
|
||||
let package = Package(name: "PerfectMustache",
|
||||
products: [.library(name: "PerfectMustache",targets: ["PerfectMustache"]),],
|
||||
dependencies: [
|
||||
.package(url: "https://github.com/PerfectlySoft/Perfect-HTTP.git", .branch("master")),
|
||||
],
|
||||
targets: [
|
||||
.target(
|
||||
name: "PerfectMustache",
|
||||
targets: [],
|
||||
dependencies: [.Package(url: "https://github.com/PerfectlySoft/Perfect-HTTP.git", majorVersion: 3)],
|
||||
exclude: []
|
||||
)
|
||||
dependencies: ["PerfectHTTP"]),
|
||||
.testTarget(
|
||||
name: "PerfectMustacheTests",
|
||||
dependencies: ["PerfectMustache"]),
|
||||
])
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
<p align="center">
|
||||
<a href="https://developer.apple.com/swift/" target="_blank">
|
||||
<img src="https://img.shields.io/badge/Swift-4.0-orange.svg?style=flat" alt="Swift 4.0">
|
||||
<img src="https://img.shields.io/badge/Swift-4.1-orange.svg?style=flat" alt="Swift 4.1">
|
||||
</a>
|
||||
<a href="https://developer.apple.com/swift/" target="_blank">
|
||||
<img src="https://img.shields.io/badge/Platforms-OS%20X%20%7C%20Linux%20-lightgray.svg?style=flat" alt="Platforms OS X | Linux">
|
||||
|
@ -48,7 +48,7 @@ This package is designed to work along with [Perfect](https://github.com/Perfect
|
|||
To start, add this project as a dependency in your Package.swift file.
|
||||
|
||||
```swift
|
||||
.Package(url: "https://github.com/PerfectlySoft/Perfect-Mustache.git", majorVersion: 3)
|
||||
.package(url: "https://github.com/PerfectlySoft/Perfect-Mustache.git", .branch("master"))
|
||||
```
|
||||
|
||||
Basic usage:
|
||||
|
|
|
@ -610,7 +610,11 @@ public class MustacheTemplate : MustacheGroupTag {
|
|||
override func populateClone(_ tag: MustacheTag) {
|
||||
super.populateClone(tag)
|
||||
if let template = tag as? MustacheTemplate {
|
||||
#if swift(>=4.1)
|
||||
template.pragmas = self.pragmas.compactMap { $0.clone() as? MustachePragmaTag }
|
||||
#else
|
||||
template.pragmas = self.pragmas.flatMap { $0.clone() as? MustachePragmaTag }
|
||||
#endif
|
||||
self.templateName = template.templateName
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue