From 49578c4bec871a6d1357ebcaf32e9cc20dcb5941 Mon Sep 17 00:00:00 2001 From: Thanh Le Date: Sat, 4 Jul 2026 10:44:05 +0200 Subject: [PATCH] Remove unused and unimplemented Router.withPrefix --- .../main/scala/play/api/routing/Router.scala | 19 ------------------- .../inject/forwardsRouter.scala.twirl | 3 --- .../snapshot/routes/lila-generated.txt | 3 --- 3 files changed, 25 deletions(-) diff --git a/core/play/src/main/scala/play/api/routing/Router.scala b/core/play/src/main/scala/play/api/routing/Router.scala index b47ebfb3d0..93a64e267a 100644 --- a/core/play/src/main/scala/play/api/routing/Router.scala +++ b/core/play/src/main/scala/play/api/routing/Router.scala @@ -20,24 +20,6 @@ trait Router: */ def routes: Router.Routes - /** - * Get a new router that routes requests to `s"$prefix/$path"` in the same way this router routes requests - * to `path`. - * - * @return - * the prefixed router - */ - def withPrefix(prefix: String): Router - - /** - * An alternative syntax for `withPrefix`. For example: - * - * {{{ - * val router = "/bar" /: barRouter - * }}} - */ - final def /:(prefix: String): Router = withPrefix(prefix) - /** * A lifted version of the routes partial function. */ @@ -48,7 +30,6 @@ trait Router: * `router` */ final def orElse(other: Router): Router = new Router: - def withPrefix(prefix: String): Router = self.withPrefix(prefix).orElse(other.withPrefix(prefix)) def routes: Routes = self.routes.orElse(other.routes) /** diff --git a/dev-mode/routes-compiler/src/main/twirl/play/routes/compiler/inject/forwardsRouter.scala.twirl b/dev-mode/routes-compiler/src/main/twirl/play/routes/compiler/inject/forwardsRouter.scala.twirl index d9edb7a66b..5eda3b20e7 100644 --- a/dev-mode/routes-compiler/src/main/twirl/play/routes/compiler/inject/forwardsRouter.scala.twirl +++ b/dev-mode/routes-compiler/src/main/twirl/play/routes/compiler/inject/forwardsRouter.scala.twirl @@ -22,9 +22,6 @@ final class Routes( @dep.ident: @dep.clazz,} ) extends GeneratedRouter @ob - final val prefix: String = "/" - def withPrefix(addPrefix: String): Routes = ??? - @for((rules, pathIndex) <- pathRules.map(_._2).zipWithIndex){ @for((dep, index) <- rules.zipWithIndex){@dep.rule match { case route @ Route(verb, path, call, comments, modifiers) => { diff --git a/dev-mode/routes-compiler/src/test/resources/snapshot/routes/lila-generated.txt b/dev-mode/routes-compiler/src/test/resources/snapshot/routes/lila-generated.txt index da09e7a357..2623032e81 100644 --- a/dev-mode/routes-compiler/src/test/resources/snapshot/routes/lila-generated.txt +++ b/dev-mode/routes-compiler/src/test/resources/snapshot/routes/lila-generated.txt @@ -53,9 +53,6 @@ final class Routes( Feed_14: controllers.Feed, ) extends GeneratedRouter { - final val prefix: String = "/" - def withPrefix(addPrefix: String): Routes = ??? - // @LINE:95