Skip to content

Commit 61aab8a

Browse files
authored
Merge pull request #673 from xuwei-k/for-latest-scala-3
Fix old syntax and warnings. prepare for latest Scala 3.x
2 parents 237a137 + 6306831 commit 61aab8a

8 files changed

Lines changed: 9 additions & 9 deletions

File tree

app/actors/DocumentationActor.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ object DocumentationActor extends ActorModule {
142142
* @param content The content of the resource.
143143
* @param size The size of the resource.
144144
*/
145-
case class Resource(content: Source[ByteString, _], size: Long, cacheId: String) extends Found[Resource]
145+
case class Resource(content: Source[ByteString, ?], size: Long, cacheId: String) extends Found[Resource]
146146

147147
/**
148148
* Update the documentation.

app/actors/DocumentationLoadingActor.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ object DocumentationLoadingActor {
4040
case class V1PageExists(page: String, repo: FileRepository, replyTo: ActorRef[Boolean]) extends Command
4141

4242
case class V1Cheatsheet(sheets: Seq[String], title: String, otherCategories: Map[String, String])
43-
case class Resource(content: Source[ByteString, _], size: Long)
43+
case class Resource(content: Source[ByteString, ?], size: Long)
4444

4545
def apply(): Behavior[Command] = Behaviors.receiveMessage {
4646
case RenderPage(page, playDoc, replyTo) =>

app/controllers/documentation/DocumentationController.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ class DocumentationController @Inject() (
229229
for {
230230
link <- linkFuture
231231
result <- resultFuture
232-
} yield result.withHeaders(link: _*)
232+
} yield result.withHeaders(link*)
233233
}
234234

235235
def resource(lang: Option[Lang], v: String, resource: String) =
@@ -320,7 +320,7 @@ class DocumentationController @Inject() (
320320
}
321321
val entity =
322322
HttpEntity.Streamed(source, Some(size), Some(fileMimeTypes.forFileName(fileName).getOrElse(BINARY)))
323-
cacheable(Ok.sendEntity(entity).withHeaders(contentDisposition: _*), cacheId)
323+
cacheable(Ok.sendEntity(entity).withHeaders(contentDisposition*), cacheId)
324324
}
325325
}
326326
}

app/models/PlayExampleProjects.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class PlayExampleProjectsService @Inject() (
109109
}
110110
})
111111
.map { response =>
112-
response.flatMap((convertExampleProjects _).tupled)
112+
response.flatMap(convertExampleProjects.tupled)
113113
}
114114
}
115115

app/models/modules/Module.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ object Module {
3030
(__ \ "versions").write[Seq[Release]]
3131
).apply(m => (m._1.name, m._1.fullname, m._2))
3232

33-
(__ \ "modules").write(Writes.iterableWrites[(Module, Seq[Release]), Seq])
33+
(__ \ "modules").write(using Writes.iterableWrites[(Module, Seq[Release]), Seq])
3434
}
3535
}
3636

app/services/github/GitHub.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ class DefaultGitHub @Inject() (ws: WSClient, config: GitHubConfig)(using ec: Exe
134134
load[GitHubUser](expand(user.url))
135135

136136
def fetchRepoContributors(repo: Repository) =
137-
loadWithPaging[(GitHubUser, Int)](expand(repo.contributorsUrl))(
137+
loadWithPaging[(GitHubUser, Int)](expand(repo.contributorsUrl))(using
138138
implicitly[Reads[GitHubUser]].and((__ \ "contributions").read[Int]).tupled,
139139
)
140140

app/views/documentation/nav.scala.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
lang.language,
1313
reverseRouter.page(Some(lang).filterNot(_ => isDefault), v.name, pageFileName)
1414
)
15-
)">@messages("lang.name")(lang)</a>
15+
)">@messages("lang.name")(using lang)</a>
1616
}
1717

1818
<nav id="toolbar">

app/views/documentation/v2.scala.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
s"""<a href="$source">""", "</a>",
4242
s"""<a href="${reverseRouter.latest(context.alternateLang, "Documentation")}">""", "</a>",
4343
s"""<a href="https://github.com/playframework/playframework/discussions">""", "</a>"
44-
)(context.lang))
44+
)(using context.lang))
4545
</p>
4646
}
4747
}.getOrElse {

0 commit comments

Comments
 (0)