Skip to content

Commit

Permalink
Merge pull request #141 from geirolz/add-scala-version-to-string
Browse files Browse the repository at this point in the history
Add ScalaVersion toString
  • Loading branch information
lenguyenthanh authored Sep 14, 2024
2 parents a8415f6 + 05b9ebc commit ed64f8d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,14 @@ package org.typelevel.scalacoptions
import scala.Ordering.Implicits._

case class ScalaVersion(major: Long, minor: Long, patch: Long) {
def isBetween(addedVersion: ScalaVersion, removedVersion: ScalaVersion) =
def isBetween(addedVersion: ScalaVersion, removedVersion: ScalaVersion): Boolean =
this >= addedVersion && this < removedVersion

def isAtLeast(addedVersion: ScalaVersion) = this >= addedVersion
def isAtLeast(addedVersion: ScalaVersion): Boolean =
this >= addedVersion

override def toString: String =
s"$major.$minor.$patch"
}

object ScalaVersion {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class ScalacOption(
case _ => false
}

override def toString =
override def toString: String =
(option :: args).mkString("ScalacOption(", " ", ")")
}

Expand Down

0 comments on commit ed64f8d

Please sign in to comment.