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))
|
.orElse(Some(default2010Timestamp))
|
||||||
|
|
||||||
def timeFromConfiguration(config: Configuration): Option[Long] =
|
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 Some(PackageOption.FixedTimestamp(value)) => value
|
||||||
case _ => defaultTimestamp
|
case _ => defaultTimestamp
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,9 +14,9 @@ object RemoteCachePlugin extends AutoPlugin:
|
||||||
val remoteOpt = remoteCache.value
|
val remoteOpt = remoteCache.value
|
||||||
remoteOpt match
|
remoteOpt match
|
||||||
case Some(remote) =>
|
case Some(remote) =>
|
||||||
val disk = orig.collect { case r: DiskActionCacheStore =>
|
val disk = orig.collectFirst { case r: DiskActionCacheStore =>
|
||||||
r
|
r
|
||||||
}.headOption match
|
} match
|
||||||
case Some(x) => x
|
case Some(x) => x
|
||||||
case None => sys.error("disk store not found")
|
case None => sys.error("disk store not found")
|
||||||
val r = GrpcActionCacheStore(
|
val r = GrpcActionCacheStore(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue