Skip to content

Commit 3ec2684

Browse files
committed
Fix non-exhaustive checks
1 parent b14d8c8 commit 3ec2684

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

core/src/main/scala/nz/co/bottech/scala2plantuml/ClassDiagramRenderer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ object ClassDiagramRenderer {
115115
case head +: tail =>
116116
val nextOuter = renderElement(head, previous, outer, writer, elementsWithNames.names)
117117
loop(tail, Some(head), nextOuter)
118-
case Seq() =>
118+
case _ =>
119119
if (outer.nonEmpty) writer.write("\n}")
120120
writer.write('\n')
121121
}

core/src/main/scala/nz/co/bottech/scala2plantuml/DiagramModifications.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ private[scala2plantuml] object DiagramModifications {
7979
loop(tail, aggregations + aggregation, acc :+ aggregation)
8080
case head +: tail =>
8181
loop(tail, aggregations, acc :+ head)
82-
case Seq() => acc
82+
case _ => acc
8383
}
8484
val newElements = loop(elements, Set.empty, Vector.empty)
8585
elementsWithNames.copy(elements = newElements)

core/src/main/scala/nz/co/bottech/scala2plantuml/SemanticDbLoader.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ private[scala2plantuml] class SemanticDBLoader(prefixes: Seq[String], classLoade
2424
case Left(error) => loop(tail, errors ++ error)
2525
case Right(value) => Right(value)
2626
}
27-
case Seq() => Left(errors)
27+
case _ => Left(errors)
2828
}
2929
semanticdbPath(symbol).flatMap { path =>
3030
val paths =

core/src/main/scala/nz/co/bottech/scala2plantuml/TypeHierarchy.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ final private[scala2plantuml] case class TypeHierarchy(
1111
@tailrec
1212
def loop(remaining: Seq[TypeHierarchy], seen: Set[String]): Boolean =
1313
remaining match {
14-
case Nil => false
1514
case head +: tail if seen.contains(head.symbolInformation.symbol) => loop(tail, seen)
1615
case head +: _ if head.symbolInformation.symbol == parent => true
1716
case head +: tail => loop(head.parents ++ tail, seen + head.symbolInformation.symbol)
17+
case _ => false
1818
}
1919
loop(parents, Set.empty)
2020
}

0 commit comments

Comments
 (0)