diff --git a/zio-http/src/main/scala/zio/http/template/IsAttributeValue.scala b/zio-http/src/main/scala/zio/http/template/IsAttributeValue.scala index 264b30d1e5..064364c4eb 100644 --- a/zio-http/src/main/scala/zio/http/template/IsAttributeValue.scala +++ b/zio-http/src/main/scala/zio/http/template/IsAttributeValue.scala @@ -22,24 +22,21 @@ import scala.language.implicitConversions * Checks if the value A can be represented as a valid html attribute. */ sealed trait IsAttributeValue[-A] { - implicit def apply(a: A): String + def apply(a: A): String } object IsAttributeValue { - implicit def fromString: IsAttributeValue[String] = new IsAttributeValue[String] { + implicit val instanceString: IsAttributeValue[String] = new IsAttributeValue[String] { override def apply(a: String): String = a } - implicit def fromInt: IsAttributeValue[Int] = new IsAttributeValue[Int] { - override def apply(a: Int): String = a.toString - } - - implicit def fromList: IsAttributeValue[Seq[String]] = new IsAttributeValue[Seq[String]] { + implicit val instanceList: IsAttributeValue[Seq[String]] = new IsAttributeValue[Seq[String]] { override def apply(a: Seq[String]): String = a.mkString(" ") } - implicit def fromTuple2Seq: IsAttributeValue[Seq[(String, String)]] = new IsAttributeValue[Seq[(String, String)]] { - override def apply(a: Seq[(String, String)]): String = - a.map { case (k, v) => s"""${k}:${v}""" }.mkString(";") - } + implicit val instanceTuple2Seq: IsAttributeValue[Seq[(String, String)]] = + new IsAttributeValue[Seq[(String, String)]] { + override def apply(a: Seq[(String, String)]): String = + a.map { case (k, v) => s"""${k}:${v}""" }.mkString(";") + } }