Update ti use mon 0.12.0 API for Result
This commit is contained in:
parent
a4ce582429
commit
c18fa1d147
2 changed files with 2 additions and 2 deletions
|
@ -85,7 +85,7 @@ class GitDBRepo {
|
||||||
) {
|
) {
|
||||||
final GitTreeReader treeFilter = new GitTreeReader(repository).treeFilter(key);
|
final GitTreeReader treeFilter = new GitTreeReader(repository).treeFilter(key);
|
||||||
return streamTree(branchRef, treeFilter).flatMap(s ->
|
return streamTree(branchRef, treeFilter).flatMap(s ->
|
||||||
Result.invert(s.findFirst()
|
Result.swap(s.findFirst()
|
||||||
.map(NamedRevBlob::blobAsString)
|
.map(NamedRevBlob::blobAsString)
|
||||||
.map(Maybe::just)
|
.map(Maybe::just)
|
||||||
.orElseGet(Maybe::nothing)));
|
.orElseGet(Maybe::nothing)));
|
||||||
|
|
|
@ -114,7 +114,7 @@ final class LocalGitDBImpl implements GitDB, LocalGitDB {
|
||||||
public Result<Maybe<GitDBBranch>> branch(final String name) {
|
public Result<Maybe<GitDBBranch>> branch(final String name) {
|
||||||
return Result.flatMapMaybe(
|
return Result.flatMapMaybe(
|
||||||
Result.of(() -> Maybe.maybe(repository.findRef(name))),
|
Result.of(() -> Maybe.maybe(repository.findRef(name))),
|
||||||
refMaybe -> Result.invert(refMaybe.map(branchInit)));
|
refMaybe -> Result.swap(refMaybe.map(branchInit)));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue