Update ti use mon 0.12.0 API for Result

This commit is contained in:
Paul Campbell 2018-09-01 16:16:40 +01:00 committed by dependabot[bot]
parent a4ce582429
commit c18fa1d147
2 changed files with 2 additions and 2 deletions

View file

@ -85,7 +85,7 @@ class GitDBRepo {
) {
final GitTreeReader treeFilter = new GitTreeReader(repository).treeFilter(key);
return streamTree(branchRef, treeFilter).flatMap(s ->
Result.invert(s.findFirst()
Result.swap(s.findFirst()
.map(NamedRevBlob::blobAsString)
.map(Maybe::just)
.orElseGet(Maybe::nothing)));

View file

@ -114,7 +114,7 @@ final class LocalGitDBImpl implements GitDB, LocalGitDB {
public Result<Maybe<GitDBBranch>> branch(final String name) {
return Result.flatMapMaybe(
Result.of(() -> Maybe.maybe(repository.findRef(name))),
refMaybe -> Result.invert(refMaybe.map(branchInit)));
refMaybe -> Result.swap(refMaybe.map(branchInit)));
}
}