Skip to content

Commit b167575

Browse files
committed
single SeqOfNode alias in ScalaVersionSpecific
1 parent eeb49a3 commit b167575

File tree

5 files changed

+7
-11
lines changed

5 files changed

+7
-11
lines changed

shared/src/main/scala-2.12/scala/xml/ScalaVersionSpecific.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ private[xml] object ScalaVersionSpecific {
2222
override def apply(from: Coll): mutable.Builder[Node, NodeSeq] = NodeSeq.newBuilder
2323
override def apply(): mutable.Builder[Node, NodeSeq] = NodeSeq.newBuilder
2424
}
25-
type SeqNodeUnapplySeq = scala.collection.Seq[Node]
26-
27-
type ChildReturnType = scala.collection.Seq[Node]
25+
type SeqOfNode = scala.collection.Seq[Node]
2826
}
2927

3028
private[xml] trait ScalaVersionSpecificNodeSeq extends SeqLike[Node, NodeSeq] { self: NodeSeq =>

shared/src/main/scala-2.13+/scala/xml/ScalaVersionSpecific.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@ private[xml] object ScalaVersionSpecific {
2424
def newBuilder(from: Coll): Builder[Node, NodeSeq] = NodeSeq.newBuilder
2525
def fromSpecific(from: Coll)(it: IterableOnce[Node]): NodeSeq = (NodeSeq.newBuilder ++= from).result()
2626
}
27-
type SeqNodeUnapplySeq = scala.collection.immutable.Seq[Node]
28-
29-
type ChildReturnType = scala.collection.immutable.Seq[Node]
27+
type SeqOfNode = scala.collection.immutable.Seq[Node]
3028
}
3129

3230
private[xml] trait ScalaVersionSpecificNodeSeq

shared/src/main/scala/scala/xml/Elem.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ object Elem {
2727
def apply(prefix: String, label: String, attributes: MetaData, scope: NamespaceBinding, minimizeEmpty: Boolean, child: Node*): Elem =
2828
new Elem(prefix, label, attributes, scope, minimizeEmpty, child: _*)
2929

30-
def unapplySeq(n: Node): Option[(String, String, MetaData, NamespaceBinding, ScalaVersionSpecific.SeqNodeUnapplySeq)] =
30+
def unapplySeq(n: Node): Option[(String, String, MetaData, NamespaceBinding, ScalaVersionSpecific.SeqOfNode)] =
3131
n match {
3232
case _: SpecialNode | _: Group => None
3333
case _ => Some((n.prefix, n.label, n.attributes, n.scope, n.child.toSeq))

shared/src/main/scala/scala/xml/Node.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ object Node {
2828
/** the empty namespace */
2929
val EmptyNamespace: String = ""
3030

31-
def unapplySeq(n: Node): Some[(String, MetaData, ScalaVersionSpecific.SeqNodeUnapplySeq)] =
31+
def unapplySeq(n: Node): Some[(String, MetaData, ScalaVersionSpecific.SeqOfNode)] =
3232
Some((n.label, n.attributes, n.child.toSeq))
3333
}
3434

@@ -120,12 +120,12 @@ abstract class Node extends NodeSeq with ScalaVersionSpecificNode {
120120
*
121121
* @return all children of this node
122122
*/
123-
def child: ScalaVersionSpecific.ChildReturnType
123+
def child: ScalaVersionSpecific.SeqOfNode
124124

125125
/**
126126
* Children which do not stringify to "" (needed for equality)
127127
*/
128-
def nonEmptyChildren: ScalaVersionSpecific.ChildReturnType = child.filterNot(_.toString.isEmpty)
128+
def nonEmptyChildren: ScalaVersionSpecific.SeqOfNode = child.filterNot(_.toString.isEmpty)
129129

130130
/**
131131
* Descendant axis (all descendants of this node, not including node itself)

shared/src/main/scala/scala/xml/QNode.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ package xml
2020
* @author Burak Emir
2121
*/
2222
object QNode {
23-
def unapplySeq(n: Node): Some[(String, String, MetaData, ScalaVersionSpecific.SeqNodeUnapplySeq)] =
23+
def unapplySeq(n: Node): Some[(String, String, MetaData, ScalaVersionSpecific.SeqOfNode)] =
2424
Some((n.scope.getURI(n.prefix), n.label, n.attributes, n.child.toSeq))
2525
}

0 commit comments

Comments
 (0)