Skip to content

Commit

Permalink
Merge pull request #225 from sangria-graphql/code_clean_up
Browse files Browse the repository at this point in the history
minor code cleanup
  • Loading branch information
yanns authored Sep 19, 2024
2 parents 43f4981 + dd9906f commit 0ceddc3
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/main/scala/sangria/marshalling/ArrayMapBuilder.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class ArrayMapBuilder[T](keys: Seq[String]) extends Iterable[(String, T)] {
private val indexLookup = keys.iterator.zipWithIndex.toMap
private val indexesSet = MutableSet[Int]()

def add(key: String, elem: T) = {
def add(key: String, elem: T): ArrayMapBuilder[T] = {
val idx = indexLookup(key)

elements(idx) = key -> elem
Expand Down Expand Up @@ -65,9 +65,9 @@ class ArrayMapBuilder[T](keys: Seq[String]) extends Iterable[(String, T)] {

override def iterator: Iterator[(String, T)] =
new Iterator[(String, T)] {
var index = -1
var nextIndex = -1
val elementsLength = elements.length
private var index = -1
private var nextIndex = -1
private val elementsLength = elements.length

@tailrec def nextIndex(current: Int): Int = {
val next = current + 1
Expand Down
1 change: 0 additions & 1 deletion src/main/scala/sangria/marshalling/FromInput.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package sangria.marshalling

import scala.annotation.implicitNotFound
import scala.language.higherKinds

@implicitNotFound(
"Type ${Val} cannot be used as an input. Please consider defining an implicit instance of `FromInput` for it.")
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/sangria/marshalling/MarshallingUtil.scala
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ object MarshallingUtil {
}

implicit class MarshaledConverter[In: InputUnmarshaller](in: In) {
def convertMarshaled[Out: ResultMarshallerForType] = convert(in)
def convertMarshaled[Out: ResultMarshallerForType]: Out = convert(in)
}

implicit class ResultMarshallerOps(val m: ResultMarshaller) extends AnyVal {
Expand Down
1 change: 0 additions & 1 deletion src/main/scala/sangria/marshalling/ToInput.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package sangria.marshalling
import sangria.util.tag._

import scala.annotation.implicitNotFound
import scala.language.higherKinds

@implicitNotFound(
"Type ${Val} cannot be used as a default value. Please consider defining an implicit instance of `ToInput` for it.")
Expand Down

0 comments on commit 0ceddc3

Please sign in to comment.