Skip to content

Commit

Permalink
Make ScalaVersionSpecific non-public
Browse files Browse the repository at this point in the history
  • Loading branch information
lrytz committed May 23, 2018
1 parent c01ec90 commit f2aea77
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package scala.xml
import scala.collection.SeqLike
import scala.collection.generic.CanBuildFrom

object ScalaVersionSpecific {
private[xml] object ScalaVersionSpecific {
import NodeSeq.Coll
type CBF[-From, -A, +C] = CanBuildFrom[From, A, C]
object NodeSeqCBF extends CanBuildFrom[Coll, Node, NodeSeq] {
Expand All @@ -12,11 +12,11 @@ object ScalaVersionSpecific {
}
}

trait ScalaVersionSpecificNodeSeq extends SeqLike[Node, NodeSeq] { self: NodeSeq =>
private[xml] trait ScalaVersionSpecificNodeSeq extends SeqLike[Node, NodeSeq] { self: NodeSeq =>
/** Creates a list buffer as builder for this class */
override protected[this] def newBuilder = NodeSeq.newBuilder
}

trait ScalaVersionSpecificNodeBuffer { self: NodeBuffer =>
private[xml] trait ScalaVersionSpecificNodeBuffer { self: NodeBuffer =>
override def stringPrefix: String = "NodeBuffer"
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import scala.collection.{SeqOps, immutable, mutable}
import scala.collection.BuildFrom
import scala.collection.mutable.Builder

object ScalaVersionSpecific {
private[xml] object ScalaVersionSpecific {
import NodeSeq.Coll
type CBF[-From, -A, +C] = BuildFrom[From, A, C]
object NodeSeqCBF extends BuildFrom[Coll, Node, NodeSeq] {
Expand All @@ -14,14 +14,13 @@ object ScalaVersionSpecific {
}
}

trait ScalaVersionSpecificNodeSeq
private[xml] trait ScalaVersionSpecificNodeSeq
extends SeqOps[Node, immutable.Seq, NodeSeq]
with StrictOptimizedSeqOps[Node, immutable.Seq, NodeSeq] { self: NodeSeq =>
override def fromSpecificIterable(coll: Iterable[Node]): NodeSeq = (NodeSeq.newBuilder ++= coll).result()

override def newSpecificBuilder(): mutable.Builder[Node, NodeSeq] = NodeSeq.newBuilder
override def newSpecificBuilder: mutable.Builder[Node, NodeSeq] = NodeSeq.newBuilder
}

trait ScalaVersionSpecificNodeBuffer { self: NodeBuffer =>
private[xml] trait ScalaVersionSpecificNodeBuffer { self: NodeBuffer =>
override def className: String = "NodeBuffer"
}

0 comments on commit f2aea77

Please sign in to comment.