mirror of https://github.com/sbt/sbt.git
use collectFirst instead of collect and headOption
This commit is contained in:
parent
439e24fb84
commit
5438781142
|
|
@ -76,7 +76,7 @@ object Pkg:
|
|||
.orElse(Some(default2010Timestamp))
|
||||
|
||||
def timeFromConfiguration(config: Configuration): Option[Long] =
|
||||
(config.options.collect { case t: PackageOption.FixedTimestamp => t }).headOption match
|
||||
config.options.collectFirst { case t: PackageOption.FixedTimestamp => t } match
|
||||
case Some(PackageOption.FixedTimestamp(value)) => value
|
||||
case _ => defaultTimestamp
|
||||
|
||||
|
|
|
|||
|
|
@ -14,9 +14,9 @@ object RemoteCachePlugin extends AutoPlugin:
|
|||
val remoteOpt = remoteCache.value
|
||||
remoteOpt match
|
||||
case Some(remote) =>
|
||||
val disk = orig.collect { case r: DiskActionCacheStore =>
|
||||
val disk = orig.collectFirst { case r: DiskActionCacheStore =>
|
||||
r
|
||||
}.headOption match
|
||||
} match
|
||||
case Some(x) => x
|
||||
case None => sys.error("disk store not found")
|
||||
val r = GrpcActionCacheStore(
|
||||
|
|
|
|||
Loading…
Reference in New Issue