Skip to content

Commit 1e57a9f

Browse files
authored
Update README.md
1 parent e78fe86 commit 1e57a9f

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

Diff for: README.md

+15-15
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,24 @@ Swift bindings to [libgit2](https://github.com/libgit2/libgit2).
99
```swift
1010
let URL: URL = ...
1111
let result = Repository.at(URL)
12-
1312
switch result {
14-
case .success(let repo):
15-
13+
case let .success(repo):
1614
let latestCommit = repo
1715
.HEAD()
18-
.flatMap { repo.commit($0.oid) }
19-
20-
switch latestCommit {
21-
case .success(let commit):
22-
print("Latest Commit: \(commit.message) by \(commit.author.name)")
23-
24-
case .failure(let error):
25-
print("Could not get commit: \(error)")
26-
}
27-
28-
case .failure(let error):
29-
print("Could not open repository: \(error)")
16+
.flatMap {
17+
repo.commit($0.oid)
18+
}
19+
20+
switch latestCommit {
21+
case let .success(commit):
22+
print("Latest Commit: \(commit.message) by \(commit.author.name)")
23+
24+
case let .failure(error):
25+
print("Could not get commit: \(error)")
26+
}
27+
28+
case let .failure(error):
29+
print("Could not open repository: \(error)")
3030
}
3131
```
3232

0 commit comments

Comments
 (0)