Skip to content

Commit cba7e7c

Browse files
committed
Cleanup
1 parent 3e0351d commit cba7e7c

File tree

3 files changed

+3
-24
lines changed

3 files changed

+3
-24
lines changed

core/api/daemon/src/mill/api/daemon/internal/OptsApi.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ trait OptsApi {
66
}
77

88
trait OptGroupApi {
9-
def startsWithArg(prefix: String): Boolean
109
}
1110

1211
trait OptApi {

core/api/src/mill/api/opt/Opt.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import mill.api.daemon.internal.OptApi
55
import mill.api.JsonFormatters.given
66

77
import scala.annotation.targetName
8-
import scala.language.implicitConversions
98

109
type OptTypes = (String | os.Path)
1110

core/api/src/mill/api/opt/OptGroup.scala

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,36 +12,18 @@ case class OptGroup private (value: Seq[Opt]) extends OptGroupApi
1212
derives upickle.ReadWriter {
1313
override def toString(): String = value.mkString("(", ", ", ")")
1414

15-
// /**
16-
// * Unify multiple options into one option.
17-
// * Same as `mkString(" ")`` on a options list of type `Seq[String].
18-
// */
19-
// def mkOpt(sep: String = " "): Opt = Opt(value*)
20-
2115
def isEmpty: Boolean = value.isEmpty
2216

2317
def containsPaths: Boolean = value.exists(_.containsPaths)
2418

2519
def head: Opt = value.head
26-
@deprecated
27-
override def startsWithArg(prefix: String): Boolean = internalStartsWith(prefix)
28-
@deprecated
29-
def startsWithArg(prefix: os.Path): Boolean = internalStartsWith(prefix)
30-
@deprecated
31-
private inline def internalStartsWith(prefix: (String | os.Path)): Boolean =
32-
value.headOption.exists {
33-
head =>
34-
(head, prefix) match {
35-
case (h: String, s: String) => h == s
36-
case (h: os.Path, p: os.Path) => h == p
37-
case _ => false
38-
}
39-
}
20+
21+
def toStringSeq: Seq[String] = value.map(_.toString)
4022
}
4123

4224
object OptGroup {
4325
@targetName("applyUnion")
44-
def apply(value: (Opt | Seq[Opt])*): OptGroup = OptGroup(value.flatMap {
26+
def apply(value: (Opt | Seq[Opt])*): OptGroup = new OptGroup(value.flatMap {
4527
case a: Opt => Seq(a)
4628
case s: Seq[Opt] => s
4729
})
@@ -65,4 +47,3 @@ object OptGroup {
6547
OptGroup(s.flatMap(f(_).value))
6648

6749
}
68-

0 commit comments

Comments
 (0)