mirror of
https://github.com/sbt/sbt.git
synced 2026-09-07 02:55:23 +02:00
Use ? instead of extracting state
I was unaware of the '?' method when I wrote this.
This commit is contained in:
@@ -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)))
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user