remove call-by-name modifier for error function, doesn't work well

This commit is contained in:
Mark Harrah 2010-08-04 19:48:48 -04:00
parent fbb8db8132
commit 9c8cf4451d
2 changed files with 3 additions and 3 deletions

View File

@ -6,7 +6,7 @@ package complete
import History.number
final class History private(lines: IndexedSeq[String], error: (=> String) => Unit) extends NotNull
final class History private(lines: IndexedSeq[String], error: String => Unit) extends NotNull
{
private def reversed = lines.reverse
@ -41,7 +41,7 @@ final class History private(lines: IndexedSeq[String], error: (=> String) => Uni
object History
{
def apply(lines: Seq[String], error: (=> String) => Unit): History = new History(lines.toIndexedSeq, error)
def apply(lines: Seq[String], error: String => Unit): History = new History(lines.toIndexedSeq, error)
def number(s: String): Option[Int] =
try { Some(s.toInt) }

View File

@ -38,7 +38,7 @@ object HistoryCommands
def printHelp(): Unit =
println(helpString)
def apply(s: String, historyPath: Option[Path], maxLines: Int, error: (=> String) => Unit): Option[List[String]] =
def apply(s: String, historyPath: Option[Path], maxLines: Int, error: String => Unit): Option[List[String]] =
if(s.isEmpty)
{
printHelp()