Skip to content

Commit 50e799a

Browse files
committed
Fix clj-kondo warnings
1 parent 662e268 commit 50e799a

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

src/ring/mock/request.clj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
(defn- encode-params
1313
"Turn a map of parameters into a urlencoded string."
1414
[params]
15-
(if params
15+
(when params
1616
(codec/form-encode params)))
1717

1818
(defn header
@@ -50,7 +50,7 @@
5050
"Create a query string from a URI and a map of parameters."
5151
[request params]
5252
(let [query (:query-string request)]
53-
(if (or query params)
53+
(when (or query params)
5454
(string/join "&"
5555
(remove string/blank?
5656
[query (encode-params params)])))))
@@ -74,7 +74,7 @@
7474
"Set the body of the request. The supplied body value can be a string or
7575
a map of parameters to be url-encoded."
7676
{:arglists '([request body-value])}
77-
(fn [request x] (type x)))
77+
(fn [_request x] (type x)))
7878

7979
(defmethod body String [request ^String string]
8080
(body request (.getBytes string)))
@@ -89,7 +89,7 @@
8989
(content-type "application/x-www-form-urlencoded")
9090
(body (encode-params params))))
9191

92-
(defmethod body nil [request params]
92+
(defmethod body nil [request _params]
9393
request)
9494

9595
(defn json-body

test/ring/mock/request_test.clj

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
(ns ring.mock.request-test
2-
(:require [clojure.java.io :as io])
3-
(:use clojure.test
4-
ring.mock.request))
2+
(:require [clojure.java.io :as io]
3+
[clojure.test :refer [deftest is testing]]
4+
[ring.mock.request :refer [body content-length content-type cookie
5+
header json-body multipart-body
6+
query-string request]]))
57

68
(deftest test-request
79
(testing "relative uri"

0 commit comments

Comments
 (0)