Skip to content

Commit ab3e5ad

Browse files
committed
reducing line length to <= 100 chars - I miss scalafmt
1 parent 2792d8b commit ab3e5ad

File tree

2 files changed

+19
-9
lines changed

2 files changed

+19
-9
lines changed

os/src/Using.scala

+9-4
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ import scala.util.control.{ControlThrowable, NonFatal}
9595
* - `java.lang.VirtualMachineError`
9696
* - `java.lang.LinkageError`
9797
* - `java.lang.InterruptedException` and `java.lang.ThreadDeath`
98-
* - [[scala.util.control.NonFatal fatal exceptions]], excluding `scala.util.control.ControlThrowable`
98+
* - [[scala.util.control.NonFatal fatal exceptions]], excluding
99+
* `scala.util.control.ControlThrowable`
99100
* - `scala.util.control.ControlThrowable`
100101
* - all other exceptions
101102
*
@@ -115,7 +116,8 @@ object Using {
115116
* @return a [[Try]] containing an exception if one or more were thrown,
116117
* or the result of the operation if no exceptions were thrown
117118
*/
118-
def apply[R: Releasable, A](resource: => R)(f: R => A): Try[A] = Try { Using.resource(resource)(f) }
119+
def apply[R: Releasable, A](resource: => R)(f: R => A): Try[A] =
120+
Try { Using.resource(resource)(f) }
119121

120122
/** A resource manager.
121123
*
@@ -236,10 +238,13 @@ object Using {
236238
case _: LinkageError => 3
237239
case _: InterruptedException | _: ThreadDeath => 2
238240
case _: ControlThrowable => 0
239-
case e if !NonFatal(e) => 1 // in case this method gets out of sync with NonFatal
241+
case e if !NonFatal(e) =>
242+
1 // in case this method gets out of sync with NonFatal
240243
case _ => -1
241244
}
242-
@inline def suppress(t: Throwable, suppressed: Throwable): Throwable = { t.addSuppressed(suppressed); t }
245+
@inline def suppress(t: Throwable, suppressed: Throwable): Throwable = {
246+
t.addSuppressed(suppressed); t
247+
}
243248

244249
if (score(secondary) > score(primary)) suppress(secondary, primary)
245250
else suppress(primary, secondary)

os/test/src/TempPathTests.scala

+10-5
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ object TempPathTests extends TestSuite{
1515
tempFilePath = file.toString
1616
assert(os.exists(file))
1717
}
18-
assert(!os.exists(os.Path(tempFilePath)), s"temp file did not get auto-deleted after `Using` block: $tempFilePath")
18+
assert(!os.exists(os.Path(tempFilePath)),
19+
s"temp file did not get auto-deleted after `Using` block: $tempFilePath")
1920
}
2021
test("temp.withDir") {
2122
var tempDirPath: String = null
@@ -28,7 +29,8 @@ object TempPathTests extends TestSuite{
2829
assert(os.exists(dir))
2930
assert(os.exists(file))
3031
}
31-
assert(!os.exists(os.Path(tempDirPath)), s"temp dir did not get auto-deleted after `Using` block: $tempDirPath")
32+
assert(!os.exists(os.Path(tempDirPath)),
33+
s"temp dir did not get auto-deleted after `Using` block: $tempDirPath")
3234
}
3335
}
3436

@@ -39,7 +41,8 @@ object TempPathTests extends TestSuite{
3941
tempFilePath = file.toString
4042
assert(os.exists(file))
4143
}
42-
assert(!os.exists(os.Path(tempFilePath)), s"temp file did not get auto-deleted after `Using` block: $tempFilePath")
44+
assert(!os.exists(os.Path(tempFilePath)),
45+
s"temp file did not get auto-deleted after `Using` block: $tempFilePath")
4346
}
4447
test("directory") {
4548
var tempDirPath: String = null
@@ -52,7 +55,8 @@ object TempPathTests extends TestSuite{
5255
assert(os.exists(dir))
5356
assert(os.exists(file))
5457
}
55-
assert(!os.exists(os.Path(tempDirPath)), s"temp dir did not get auto-deleted after `Using` block: $tempDirPath")
58+
assert(!os.exists(os.Path(tempDirPath)),
59+
s"temp dir did not get auto-deleted after `Using` block: $tempDirPath")
5660
}
5761

5862
test("multiple files") {
@@ -65,7 +69,8 @@ object TempPathTests extends TestSuite{
6569
files.foreach(file => assert(os.exists(file)))
6670
}
6771
tempFilePaths.foreach { file =>
68-
assert(!os.exists(os.Path(file)), s"temp file did not get auto-deleted after `Using` block: $file")
72+
assert(!os.exists(os.Path(file)),
73+
s"temp file did not get auto-deleted after `Using` block: $file")
6974
}
7075
}
7176
}

0 commit comments

Comments
 (0)