Added option to have custom download location

The location is automatically added to list of supported paths for caching
This commit is contained in:
Viktor De Pasquale
2019-07-13 13:26:33 +02:00
committed by John Wu
parent 7cd814d917
commit e5118418b2
8 changed files with 200 additions and 107 deletions

View File

@@ -35,4 +35,11 @@ inline fun <In : InputStream, Out : OutputStream> withStreams(
withBoth(reader, writer)
}
}
}
inline fun <T, R> List<T>.firstMap(mapper: (T) -> R?): R {
for (item: T in this) {
return mapper(item) ?: continue
}
throw NoSuchElementException("Collection contains no element matching the predicate.")
}