Skip to content

Commit 7f51078

Browse files
authored
Merge pull request scala/scala#8125 from asakaev/fix-formatting
Fix formatting
2 parents 5fc13ab + 8657259 commit 7f51078

File tree

9 files changed

+22
-22
lines changed

9 files changed

+22
-22
lines changed

library/src/scala/Console.scala

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ object Console extends AnsiColor {
162162
* @see `withOut[T](out:OutputStream)(thunk: => T)`
163163
* @group io-redefinition
164164
*/
165-
def withOut[T](out: PrintStream)(thunk: =>T): T =
165+
def withOut[T](out: PrintStream)(thunk: => T): T =
166166
outVar.withValue(out)(thunk)
167167

168168
/** Sets the default output stream for the duration
@@ -175,7 +175,7 @@ object Console extends AnsiColor {
175175
* @see `withOut[T](out:PrintStream)(thunk: => T)`
176176
* @group io-redefinition
177177
*/
178-
def withOut[T](out: OutputStream)(thunk: =>T): T =
178+
def withOut[T](out: OutputStream)(thunk: => T): T =
179179
withOut(new PrintStream(out))(thunk)
180180

181181
/** Set the default error stream for the duration
@@ -188,10 +188,10 @@ object Console extends AnsiColor {
188188
* @param thunk the code to execute with
189189
* the new error stream active
190190
* @return the results of `thunk`
191-
* @see `withErr[T](err:OutputStream)(thunk: =>T)`
191+
* @see `withErr[T](err:OutputStream)(thunk: => T)`
192192
* @group io-redefinition
193193
*/
194-
def withErr[T](err: PrintStream)(thunk: =>T): T =
194+
def withErr[T](err: PrintStream)(thunk: => T): T =
195195
errVar.withValue(err)(thunk)
196196

197197
/** Sets the default error stream for the duration
@@ -201,10 +201,10 @@ object Console extends AnsiColor {
201201
* @param thunk the code to execute with
202202
* the new error stream active
203203
* @return the results of `thunk`
204-
* @see `withErr[T](err:PrintStream)(thunk: =>T)`
204+
* @see `withErr[T](err:PrintStream)(thunk: => T)`
205205
* @group io-redefinition
206206
*/
207-
def withErr[T](err: OutputStream)(thunk: =>T): T =
207+
def withErr[T](err: OutputStream)(thunk: => T): T =
208208
withErr(new PrintStream(err))(thunk)
209209

210210
/** Sets the default input stream for the duration
@@ -222,10 +222,10 @@ object Console extends AnsiColor {
222222
* the new input stream active
223223
*
224224
* @return the results of `thunk`
225-
* @see `withIn[T](in:InputStream)(thunk: =>T)`
225+
* @see `withIn[T](in:InputStream)(thunk: => T)`
226226
* @group io-redefinition
227227
*/
228-
def withIn[T](reader: Reader)(thunk: =>T): T =
228+
def withIn[T](reader: Reader)(thunk: => T): T =
229229
inVar.withValue(new BufferedReader(reader))(thunk)
230230

231231
/** Sets the default input stream for the duration
@@ -235,10 +235,10 @@ object Console extends AnsiColor {
235235
* @param thunk the code to execute with
236236
* the new input stream active
237237
* @return the results of `thunk`
238-
* @see `withIn[T](reader:Reader)(thunk: =>T)`
238+
* @see `withIn[T](reader:Reader)(thunk: => T)`
239239
* @group io-redefinition
240240
*/
241-
def withIn[T](in: InputStream)(thunk: =>T): T =
241+
def withIn[T](in: InputStream)(thunk: => T): T =
242242
withIn(new InputStreamReader(in))(thunk)
243243

244244
/** Prints an object to `out` using its `toString` method.

library/src/scala/collection/concurrent/Map.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ trait Map[K, V] extends scala.collection.mutable.Map[K, V] {
9494
*/
9595
def replace(k: K, v: V): Option[V]
9696

97-
override def getOrElseUpdate(key: K, op: =>V): V = get(key) match {
97+
override def getOrElseUpdate(key: K, op: => V): V = get(key) match {
9898
case Some(v) => v
9999
case None =>
100100
val v = op

library/src/scala/collection/concurrent/TrieMap.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -944,7 +944,7 @@ final class TrieMap[K, V] private (r: AnyRef, rtupd: AtomicReferenceFieldUpdater
944944
* @param op the expression that computes the value
945945
* @return the newly added value
946946
*/
947-
override def getOrElseUpdate(k: K, op: =>V): V = {
947+
override def getOrElseUpdate(k: K, op: => V): V = {
948948
val hc = computeHash(k)
949949
lookuphc(k, hc) match {
950950
case INodeBase.NO_SUCH_ELEMENT_SENTINEL =>

library/src/scala/concurrent/BlockContext.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ package scala.concurrent
2929
* {{{
3030
* val oldContext = BlockContext.current
3131
* val myContext = new BlockContext {
32-
* override def blockOn[T](thunk: =>T)(implicit permission: CanAwait): T = {
32+
* override def blockOn[T](thunk: => T)(implicit permission: CanAwait): T = {
3333
* // you'd have code here doing whatever you need to do
3434
* // when the thread is about to block.
3535
* // Then you'd chain to the previous context:
@@ -54,12 +54,12 @@ trait BlockContext {
5454
*
5555
* @throws IllegalArgumentException if the `permission` is `null`
5656
*/
57-
def blockOn[T](thunk: =>T)(implicit permission: CanAwait): T
57+
def blockOn[T](thunk: => T)(implicit permission: CanAwait): T
5858
}
5959

6060
object BlockContext {
6161
private[this] object DefaultBlockContext extends BlockContext {
62-
override final def blockOn[T](thunk: =>T)(implicit permission: CanAwait): T = thunk
62+
override final def blockOn[T](thunk: => T)(implicit permission: CanAwait): T = thunk
6363
}
6464

6565
/**

library/src/scala/concurrent/Future.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ object Future {
656656
* @param executor the execution context on which the future is run
657657
* @return the `Future` holding the result of the computation
658658
*/
659-
final def apply[T](body: =>T)(implicit executor: ExecutionContext): Future[T] =
659+
final def apply[T](body: => T)(implicit executor: ExecutionContext): Future[T] =
660660
unit.map(_ => body)
661661

662662
/** Starts an asynchronous computation and returns a `Future` instance with the result of that computation once it completes.

library/src/scala/concurrent/impl/ExecutionContextImpl.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ private[concurrent] object ExecutionContextImpl {
4949
def newThread(fjp: ForkJoinPool): ForkJoinWorkerThread =
5050
wire(new ForkJoinWorkerThread(fjp) with BlockContext {
5151
private[this] final var isBlocked: Boolean = false // This is only ever read & written if this thread is the current thread
52-
final override def blockOn[T](thunk: =>T)(implicit permission: CanAwait): T =
52+
final override def blockOn[T](thunk: => T)(implicit permission: CanAwait): T =
5353
if ((Thread.currentThread eq this) && !isBlocked && blockerPermits.tryAcquire()) {
5454
try {
5555
val b: ForkJoinPool.ManagedBlocker with (() => T) =

library/src/scala/concurrent/package.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ package object concurrent {
121121
* @throws InterruptedException in the case that a wait within the blocking `body` was interrupted
122122
*/
123123
@throws(classOf[Exception])
124-
final def blocking[T](body: =>T): T = BlockContext.current.blockOn(body)(scala.concurrent.AwaitPermission)
124+
final def blocking[T](body: => T): T = BlockContext.current.blockOn(body)(scala.concurrent.AwaitPermission)
125125
}
126126

127127
package concurrent {

library/src/scala/jdk/Accumulator.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ import scala.collection.{Stepper, StepperShape, mutable}
5454
* There are two possibilities to process elements of a primitive Accumulator without boxing:
5555
* specialized operations of the Accumulator, or the Stepper interface. The most common collection
5656
* operations are overloaded or overridden in the primitive Accumulator classes, for example
57-
* [[IntAccumulator.map(f:Int=>Int)* IntAccumulator.map]] or [[IntAccumulator.exists]]. Thanks to Scala's function specialization,
57+
* [[IntAccumulator.map(f: Int => Int)* IntAccumulator.map]] or [[IntAccumulator.exists]]. Thanks to Scala's function specialization,
5858
* `intAcc.exists(x => testOn(x))` does not incur boxing.
5959
*
6060
* The [[Stepper]] interface provides iterator-like `hasStep` and `nextStep` methods, and is

library/src/scala/util/control/Breaks.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class Breaks {
4747
}
4848

4949
sealed trait TryBlock[T] {
50-
def catchBreak(onBreak: =>T): T
50+
def catchBreak(onBreak: => T): T
5151
}
5252

5353
/**
@@ -62,8 +62,8 @@ class Breaks {
6262
* }
6363
* }}}
6464
*/
65-
def tryBreakable[T](op: =>T) = new TryBlock[T] {
66-
def catchBreak(onBreak: =>T) = try {
65+
def tryBreakable[T](op: => T) = new TryBlock[T] {
66+
def catchBreak(onBreak: => T) = try {
6767
op
6868
} catch {
6969
case ex: BreakControl =>

0 commit comments

Comments
 (0)