From fe3c6bf00316472032adc1d0bd813f0c360d0ef3 Mon Sep 17 00:00:00 2001 From: Tony Morris Date: Tue, 23 Sep 2014 22:43:26 +1000 Subject: [PATCH] Remove warning by removing by-name arguments with right-associative name. "by-name parameters will be evaluated eagerly when called as a right-associative infix operator. For more details, see SI-1980" --- src/main/scala/argonaut/Json.scala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/scala/argonaut/Json.scala b/src/main/scala/argonaut/Json.scala index cbe6126c..55c486ff 100644 --- a/src/main/scala/argonaut/Json.scala +++ b/src/main/scala/argonaut/Json.scala @@ -149,25 +149,25 @@ sealed trait Json { /** * If this is a JSON object, then prepend the given value, otherwise, return a JSON object with only the given value. */ - def ->:(k: => JsonAssoc): Json = + def ->:(k: JsonAssoc): Json = withObject(o => (k._1, k._2) +: o) /** * If this is a JSON object, and the association is set, then prepend the given value, otherwise, return a JSON object with only the given value. */ - def ->?:(o: => Option[JsonAssoc]): Json = + def ->?:(o: Option[JsonAssoc]): Json = o.map(->:(_)).getOrElse(this) /** * If this is a JSON array, then prepend the given value, otherwise, return a JSON array with only the given value. */ - def -->>:(k: => Json): Json = + def -->>:(k: Json): Json = withArray(k :: _) /** * If this is a JSON array, and the element is set, then prepend the given value, otherwise, return a JSON array with only the given value. */ - def -->>?:(o: => Option[Json]): Json = + def -->>?:(o: Option[Json]): Json = o.map(j => withArray(j :: _)).getOrElse(this) /**