summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/scala/router.scala16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/main/scala/router.scala b/src/main/scala/router.scala
index 5779256..3b15ca8 100644
--- a/src/main/scala/router.scala
+++ b/src/main/scala/router.scala
@@ -55,10 +55,10 @@ class Router[T] {
}
})
- possible.toList match {
- case Nil => None
- case (r, path) :: Nil => Some(path)
- case rs => {
+ possible match {
+ case Seq() => None
+ case Seq((r, path)) => Some(path)
+ case _ => {
// then try to disambiguate the remaining possibilities
// - we want the route with the fewest number of "extra" items in the
// mapping, after removing defaults and variable path components
@@ -66,10 +66,10 @@ class Router[T] {
(mapping.keys.toSet -- r.defaults.keys.toSet -- r.variables).size
} }
val found = possibleByRemainder(possibleByRemainder.keys.min)
- found.toList match {
- case Nil => None
- case (r, path) :: Nil => Some(path)
- case rs =>
+ found match {
+ case Seq() => None
+ case Seq((r, path)) => Some(path)
+ case rs =>
throw new AmbiguousRouteMapping(mapping, rs.map(_._1.path))
}
}