From 53c418cb872b2467400a15d6596df88512ec0bc8 Mon Sep 17 00:00:00 2001 From: Adam Nemecek Date: Sun, 11 Feb 2018 13:47:20 -0800 Subject: [PATCH] * refactoring --- LayoutKitSampleApp/Benchmarks/DataBinder.swift | 2 -- LayoutKitTests/IndexSetExtension.swift | 2 -- Sources/Internal/CGSizeExtension.swift | 1 - Sources/Views/BatchUpdates.swift | 16 ++++++++-------- Sources/Views/ReloadableViewUpdateManager.swift | 2 -- 5 files changed, 8 insertions(+), 15 deletions(-) diff --git a/LayoutKitSampleApp/Benchmarks/DataBinder.swift b/LayoutKitSampleApp/Benchmarks/DataBinder.swift index 614ef2d7..d8f77558 100644 --- a/LayoutKitSampleApp/Benchmarks/DataBinder.swift +++ b/LayoutKitSampleApp/Benchmarks/DataBinder.swift @@ -6,8 +6,6 @@ // software distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -import Foundation - protocol DataBinder { associatedtype DataType func setData(_ data: DataType) diff --git a/LayoutKitTests/IndexSetExtension.swift b/LayoutKitTests/IndexSetExtension.swift index d4213429..2289cac1 100644 --- a/LayoutKitTests/IndexSetExtension.swift +++ b/LayoutKitTests/IndexSetExtension.swift @@ -6,8 +6,6 @@ // software distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -import Foundation - extension IndexSet { /// Returns the only index in the set. /// It returns nil if there is not exactly one index in the set. diff --git a/Sources/Internal/CGSizeExtension.swift b/Sources/Internal/CGSizeExtension.swift index ee45d1e8..43b6a44c 100644 --- a/Sources/Internal/CGSizeExtension.swift +++ b/Sources/Internal/CGSizeExtension.swift @@ -7,7 +7,6 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. import CoreGraphics -import Foundation #if os(OSX) public typealias EdgeInsets = NSEdgeInsets diff --git a/Sources/Views/BatchUpdates.swift b/Sources/Views/BatchUpdates.swift index e2dc7755..e418f690 100644 --- a/Sources/Views/BatchUpdates.swift +++ b/Sources/Views/BatchUpdates.swift @@ -6,8 +6,6 @@ // software distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -import Foundation - /** A set of updates to apply to a `ReloadableView`. @@ -40,10 +38,10 @@ public struct ItemMove: Equatable { self.from = from self.to = to } -} -public func ==(lhs: ItemMove, rhs: ItemMove) -> Bool { - return lhs.from == rhs.from && lhs.to == rhs.to + public static func ==(lhs: ItemMove, rhs: ItemMove) -> Bool { + return lhs.from == rhs.from && lhs.to == rhs.to + } } /// Instruction to move a section from one index to another. @@ -55,8 +53,10 @@ public struct SectionMove: Equatable { self.from = from self.to = to } -} -public func ==(lhs: SectionMove, rhs: SectionMove) -> Bool { - return lhs.from == rhs.from && lhs.to == rhs.to + public static func ==(lhs: SectionMove, rhs: SectionMove) -> Bool { + return lhs.from == rhs.from && lhs.to == rhs.to + } } + + diff --git a/Sources/Views/ReloadableViewUpdateManager.swift b/Sources/Views/ReloadableViewUpdateManager.swift index db801d1c..b5929e9f 100644 --- a/Sources/Views/ReloadableViewUpdateManager.swift +++ b/Sources/Views/ReloadableViewUpdateManager.swift @@ -6,8 +6,6 @@ // software distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -import Foundation - /// Delegate for a `ReloadableViewUpdateManager`. protocol ReloadableViewUpdateManagerDelegate: class { var reloadableView: ReloadableView? { get }