Skip to content

Commit

Permalink
Move method attributes on a separate line
Browse files Browse the repository at this point in the history
  • Loading branch information
kean committed Jul 20, 2018
1 parent dee8e14 commit 22a0ebd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Sources/ImageCache.swift
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,8 @@ internal final class _Cache<Key: Hashable, Value> {
_trim() // _trim is extremely fast, it's OK to call it each time
}

@discardableResult func removeValue(forKey key: Key) -> Value? {
@discardableResult
func removeValue(forKey key: Key) -> Value? {
lock.lock(); defer { lock.unlock() }

guard let node = map[key] else { return nil }
Expand Down
6 changes: 4 additions & 2 deletions Sources/ImagePipeline.swift
Original file line number Diff line number Diff line change
Expand Up @@ -231,12 +231,14 @@ public /* final */ class ImagePipeline {
// MARK: Loading Images

/// Loads an image with the given url.
@discardableResult public func loadImage(with url: URL, progress: ImageTask.ProgressHandler? = nil, completion: ImageTask.Completion? = nil) -> ImageTask {
@discardableResult
public func loadImage(with url: URL, progress: ImageTask.ProgressHandler? = nil, completion: ImageTask.Completion? = nil) -> ImageTask {
return loadImage(with: ImageRequest(url: url), progress: progress, completion: completion)
}

/// Loads an image for the given request using image loading pipeline.
@discardableResult public func loadImage(with request: ImageRequest, progress: ImageTask.ProgressHandler? = nil, completion: ImageTask.Completion? = nil) -> ImageTask {
@discardableResult
public func loadImage(with request: ImageRequest, progress: ImageTask.ProgressHandler? = nil, completion: ImageTask.Completion? = nil) -> ImageTask {
let task = ImageTask(taskId: Int(OSAtomicIncrement32(&nextTaskId)), request: request)
queue.async {
// Fast preflight check.
Expand Down
3 changes: 2 additions & 1 deletion Sources/Internal.swift
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@ internal final class LinkedList<Element> {
}

/// Adds an element to the end of the list.
@discardableResult func append(_ element: Element) -> Node {
@discardableResult
func append(_ element: Element) -> Node {
let node = Node(value: element)
append(node)
return node
Expand Down

0 comments on commit 22a0ebd

Please sign in to comment.