mirror of
https://github.com/realm/SwiftLint.git
synced 2026-06-06 20:18:40 +00:00
10ba712748
Because of the bug https://bugs.swift.org/browse/SR-5971 SwiftLint crashes when linting on Linux files like https://github.com/xmartlabs/Eureka/blob/master/Example/Example/ViewController.swift
24 lines
542 B
Swift
24 lines
542 B
Swift
//
|
|
// CharacterSet+SwiftLint.swift
|
|
// SwiftLint
|
|
//
|
|
// Created by Cyril Lashkevich on 3/11/18.
|
|
// Copyright © 2018 Realm. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
// This is workaround for https://bugs.swift.org/browse/SR-5971
|
|
// Can be removed when
|
|
// https://github.com/apple/swift-corelibs-foundation/pull/1471 is merged
|
|
internal extension CharacterSet {
|
|
init(safeCharactersIn string: String) {
|
|
#if os(Linux)
|
|
self.init()
|
|
insert(charactersIn: string)
|
|
#else
|
|
self.init(charactersIn: string)
|
|
#endif
|
|
}
|
|
}
|