Skip to content

Commit 095a5c8

Browse files
authored
eliminate some warnings (#271)
(which are errors under -Xsource:3)
1 parent ca952b8 commit 095a5c8

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/test/scala/scala/async/FutureSpec.scala

+4-4
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,14 @@ class FutureSpec {
9595
val a = await(future0.mapTo[Int]) // returns 5
9696
val b = await(asyncInt(a)) // returns "10"
9797
val c = await(asyncInt(7)) // returns "14"
98-
b + "-" + c
98+
s"$b-$c"
9999
}
100100

101101
val future2 = async {
102102
val a = await(future0.mapTo[Int])
103103
val b = await((Future { (a * 2).toString }).mapTo[Int])
104104
val c = await(Future { (7 * 2).toString })
105-
b + "-" + c
105+
s"$b-$c"
106106
}
107107

108108
Await.result(future1, defaultTimeout) mustBe ("10-14")
@@ -123,13 +123,13 @@ class FutureSpec {
123123
Res(a: Int) <- asyncReq(Req("Hello"))
124124
Res(b: String) <- asyncReq(Req(a))
125125
Res(c: String) <- asyncReq(Req(7))
126-
} yield b + "-" + c
126+
} yield s"$b-$c"
127127

128128
val future2 = for {
129129
Res(a: Int) <- asyncReq(Req("Hello"))
130130
Res(b: Int) <- asyncReq(Req(a))
131131
Res(c: Int) <- asyncReq(Req(7))
132-
} yield b + "-" + c
132+
} yield s"$b-$c"
133133

134134
Await.result(future1, defaultTimeout) mustBe ("10-14")
135135
intercept[NoSuchElementException] { Await.result(future2, defaultTimeout) }

src/test/scala/scala/async/TestUtil.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ object TestUtil {
5959
}
6060

6161
implicit class objectops(obj: Any) {
62-
def mustBe(other: Any): Unit = assert(obj == other, obj + " is not " + other)
62+
def mustBe(other: Any): Unit = assert(obj == other, s"$obj is not $other")
6363

6464
def mustEqual(other: Any): Unit = mustBe(other)
6565
}

0 commit comments

Comments
 (0)