Use ? instead of extracting state

I was unaware of the '?' method when I wrote this.
This commit is contained in:
Ethan Atkins 2018-12-25 20:24:49 -08:00
parent 2ef97768a0
commit 116d2ae815
1 changed files with 2 additions and 5 deletions

View File

@ -619,13 +619,10 @@ object Defaults extends BuildCommon {
watchOnTermination := Watched.onTermination,
watchConfig := {
val sources = watchTransitiveSources.value ++ watchProjectTransitiveSources.value
val extracted = Project.extract(state.value)
val wm = extracted
.getOpt(watchingMessage)
val wm = watchingMessage.?.value
.map(w => (count: Int) => Some(w(WatchState.empty(sources).withCount(count))))
.getOrElse(watchStartMessage.value)
val tm = extracted
.getOpt(triggeredMessage)
val tm = triggeredMessage.?.value
.map(
tm => (_: TypedPath, count: Int) => Some(tm(WatchState.empty(sources).withCount(count)))
)