Skip to content

Commit

Permalink
use Iterable instead of Traversable
Browse files Browse the repository at this point in the history
  • Loading branch information
xuwei-k committed May 13, 2018
1 parent d3dc6c1 commit d0af8f3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions core/src/main/scala/requests.scala
Expand Up @@ -186,7 +186,7 @@ trait HeaderVerbs extends RequestVerbs {
* Append a collecton of headers to the headers already
* on the request.
*/
def <:< (hs: Traversable[(String,String)]) = {
def <:< (hs: Iterable[(String,String)]) = {
hs.foldLeft(subject) {
case (s, (key, value)) =>
s.addHeader(key, value)
Expand All @@ -197,7 +197,7 @@ trait HeaderVerbs extends RequestVerbs {
* Append a collecton of headers to the headers already
* on the request.
*/
def appendHeaders (hs: Traversable[(String, String)]) =
def appendHeaders (hs: Iterable[(String, String)]) =
<:<(hs)
}

Expand All @@ -206,7 +206,7 @@ trait ParamVerbs extends RequestVerbs {
* Adds `params` to the request body.
* Sets request method to POST unless it has been explicitly set.
*/
def << (params: Traversable[(String,String)]) = {
def << (params: Iterable[(String,String)]) = {
params.foldLeft(subject.implyMethod("POST")) {
case (s, (key, value)) =>
s.addParameter(key, value)
Expand All @@ -217,7 +217,7 @@ trait ParamVerbs extends RequestVerbs {
* Adds `params` to the request body.
* Sets request method to POST unless it has been explicitly set.
*/
def appendBodyParams(params: Traversable[(String, String)]) =
def appendBodyParams(params: Iterable[(String, String)]) =
<<(params)

/**
Expand Down Expand Up @@ -255,7 +255,7 @@ trait ParamVerbs extends RequestVerbs {
/**
* Adds `params` as query parameters
*/
def <<? (params: Traversable[(String,String)]) = {
def <<? (params: Iterable[(String,String)]) = {
params.foldLeft(subject) {
case (s, (key, value)) =>
s.addQueryParameter(key, value)
Expand All @@ -265,7 +265,7 @@ trait ParamVerbs extends RequestVerbs {
/**
* Adds `params` as query parameters
*/
def appendQueryParams(params: Traversable[(String, String)]) = {
def appendQueryParams(params: Iterable[(String, String)]) = {
<<?(params)
}
}
Expand Down
2 changes: 1 addition & 1 deletion docs/02/b.markdown
Expand Up @@ -22,7 +22,7 @@ As a trivial example, let's implement a method to return the average
of some integers.

```scala
def average(nums: Traversable[Int]) = {
def average(nums: Iterable[Int]) = {
if (nums.isEmpty) Left("Can't average emptiness")
else Right(nums.sum / nums.size)
}
Expand Down
2 changes: 1 addition & 1 deletion docs/03/a.markdown
Expand Up @@ -77,7 +77,7 @@ You can also add query parameters with the `<<?` verb.
def myRequestWithParams = myRequest <<? Map("key" -> "value")
```

The `<<?` verb can consume any kind of `Traversable` that contains a
The `<<?` verb can consume any kind of `Iterable` that contains a
`(String, String)`, so if you'd like to use the verb form to add multiple
query parameters with the same key, you'd just switch to using a `List`:

Expand Down

0 comments on commit d0af8f3

Please sign in to comment.