Skip to content
This repository has been archived by the owner on Apr 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #70 from nodes-vapor/feature/fix-swift-5-warnings
Browse files Browse the repository at this point in the history
Remove redundant access modifiers
  • Loading branch information
cweinberger authored May 7, 2019
2 parents e09e2af + 48a180d commit aa01552
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
8 changes: 4 additions & 4 deletions Sources/Paginator/Paginatable/ArrayPaginatable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public extension ArrayPaginatable {
}

public extension Array where Iterator.Element: Codable {
public func paginate<P: Paginator>(
func paginate<P: Paginator>(
for req: Request
) throws -> Future<P> where
P: ArrayPaginatable,
Expand All @@ -31,7 +31,7 @@ public extension Array where Iterator.Element: Codable {
return try self.paginate(count: self.count, for: req)
}

public func paginate<P: Paginator>(
func paginate<P: Paginator>(
count: Int,
for req: Request
) throws -> Future<P> where
Expand All @@ -53,7 +53,7 @@ extension Array: Transformable where Iterator.Element: Codable {
}

public extension TransformingQuery {
public func paginate<P: Paginator>(
func paginate<P: Paginator>(
for req: Request
) throws -> Future<P> where
P: ArrayPaginatable,
Expand All @@ -64,7 +64,7 @@ public extension TransformingQuery {
return try self.paginate(count: self.source.count, for: req)
}

public func paginate<P: Paginator>(
func paginate<P: Paginator>(
count: Int,
for req: Request
) throws -> Future<P> where
Expand Down
8 changes: 4 additions & 4 deletions Sources/Paginator/Paginatable/QueryBuilderPaginatable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public protocol QueryBuilderPaginatable: Paginatable {
}

public extension QueryBuilder {
public func paginate<P: Paginator>(
func paginate<P: Paginator>(
for req: Request
) throws -> Future<P> where
P: QueryBuilderPaginatable,
Expand All @@ -22,7 +22,7 @@ public extension QueryBuilder {
return try paginate(count: count(), for: req)
}

public func paginate<P: Paginator>(
func paginate<P: Paginator>(
count: Future<Int>,
for req: Request
) throws -> Future<P> where
Expand All @@ -40,7 +40,7 @@ extension QueryBuilder: Transformable {
}

public extension TransformingQuery {
public func paginate<P: Paginator, T>(
func paginate<P: Paginator, T>(
for req: Request
) throws -> Future<P> where
T: QuerySupporting,
Expand All @@ -52,7 +52,7 @@ public extension TransformingQuery {
return try self.paginate(count: self.source.count(), for: req)
}

public func paginate<P: Paginator, T>(
func paginate<P: Paginator, T>(
count: Future<Int>,
for req: Request
) throws -> Future<P> where
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ public struct OffsetPaginator<Object: Codable>: Paginator {
}

public extension OffsetPaginator {
public typealias ResultObject = Object
public typealias PaginatableMetaData = OffsetMetaData
typealias ResultObject = Object
typealias PaginatableMetaData = OffsetMetaData
}

public struct OffsetMetaData: Codable {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Vapor

public extension OffsetMetaData {
public static func nextAndPreviousLinks(
static func nextAndPreviousLinks(
currentPage: Int,
totalPages: Int,
url: URL
Expand All @@ -21,13 +21,13 @@ public extension OffsetMetaData {
return (previous, next)
}

public func links(
func links(
in range: CountableClosedRange<Int>
) throws -> [String] {
return try range.map { try link(for: $0) }
}

public func link(
func link(
for page: Int
) throws -> String {
return try OffsetMetaData.link(url: self.url, page: page)
Expand Down
4 changes: 2 additions & 2 deletions Sources/Paginator/Tags/OffsetPaginatorControlData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public enum TagContextPaginatorError: Error {
}

public extension OffsetPaginator {
public func userInfo() throws -> [AnyHashable: Any] {
func userInfo() throws -> [AnyHashable: Any] {
guard let metaData = self.metaData() else {
throw TagContextPaginatorError.paginatorDoesNotContainMetaData
}
Expand All @@ -105,7 +105,7 @@ public extension OffsetPaginator {
}

public extension TagContext {
public func requireOffsetPaginatorControlData() throws -> OffsetPaginatorControlData {
func requireOffsetPaginatorControlData() throws -> OffsetPaginatorControlData {
guard
let metaData = self.context.userInfo[userInfoKey] as? OffsetPaginatorControlData
else {
Expand Down
6 changes: 3 additions & 3 deletions Sources/Paginator/Transform.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public protocol Transformable {
}

public extension Transformable {
public func transform<T: Codable>(
func transform<T: Codable>(
on req: Request,
_ transform: @escaping (TransformableQueryResult) throws -> T
) throws -> TransformingQuery<TransformableQuery, TransformableQueryResult, T> {
Expand All @@ -37,7 +37,7 @@ public extension Transformable {
return try self.transform(on: req, newTransform)
}

public func transform<T: Codable>(
func transform<T: Codable>(
on req: Request,
_ transform: @escaping (TransformableQueryResult) throws -> Future<T>
) -> TransformingQuery<Self, Self.TransformableQueryResult, T> {
Expand All @@ -48,7 +48,7 @@ public extension Transformable {
return TransformingQuery(source: self, transform: newTransform)
}

public func transform<T: Codable>(
func transform<T: Codable>(
on req: Request,
_ transform: @escaping ([TransformableQueryResult]) throws -> Future<[T]>
) -> TransformingQuery<Self, Self.TransformableQueryResult, T> {
Expand Down

0 comments on commit aa01552

Please sign in to comment.