Skip to content
This repository was archived by the owner on May 1, 2023. It is now read-only.

Commit 655723f

Browse files
author
안지훈
authored
Update Snippet
Return Value Void
1 parent a2ae8c2 commit 655723f

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

Sources/XcodeSnippet/Snippet.swift

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@ public protocol Snippet {
88

99
// MARK: - public
1010
public extension Snippet {
11-
func install() throws -> Self {
11+
func install() throws -> Void {
1212
let folder = try Folder(path: "~/Library/Developer/Xcode/UserData/CodeSnippets")
1313
let semaphore = DispatchSemaphore(value: 0)
14-
var result: Result<Self, Error>?
14+
var result: Result<Void, Error>?
1515
let completionHandler = { result = $0 }
1616

1717
Task {
1818
do {
1919
try xcodeSnippet.forEach {
2020
try $0.generateSnippet(folder: folder)
2121
}
22-
completionHandler(.success(self))
22+
completionHandler(.success)
2323
} catch {
2424
completionHandler(.failure(error))
2525
}
@@ -28,3 +28,8 @@ public extension Snippet {
2828
return try result!.get()
2929
}
3030
}
31+
32+
// MARK: - Private Extension
33+
private extension Result where Success == Void {
34+
static var success: Result { .success(()) }
35+
}

0 commit comments

Comments
 (0)