From 9fa61f8d82b30eead9f334387b9961198becd1a2 Mon Sep 17 00:00:00 2001 From: Louis Pilfold Date: Tue, 19 Nov 2024 17:28:22 +0000 Subject: [PATCH] v3.7.1 --- CHANGELOG.md | 4 ++++ gleam.toml | 2 +- src/gleam/http/request.gleam | 12 +++--------- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7469641..0fbfad6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## v3.7.1 - 2024-11-19 + +- Fixed warnings on `gleam_stdlib` v0.42.0. + ## v3.7.0 - 2024-09-12 - The `gleam/http/request` module gains the `remove_cookie` function. diff --git a/gleam.toml b/gleam.toml index 9b59db4..df2add8 100644 --- a/gleam.toml +++ b/gleam.toml @@ -1,5 +1,5 @@ name = "gleam_http" -version = "3.7.0" +version = "3.7.1" licences = ["Apache-2.0"] description = "Types and functions for Gleam HTTP clients and servers" gleam = ">= 1.0.0" diff --git a/src/gleam/http/request.gleam b/src/gleam/http/request.gleam index a992433..1ba1571 100644 --- a/src/gleam/http/request.gleam +++ b/src/gleam/http/request.gleam @@ -4,7 +4,6 @@ import gleam/list import gleam/option.{type Option} import gleam/result import gleam/string -import gleam/string_builder import gleam/uri.{type Uri, Uri} /// A HTTP request. @@ -179,18 +178,13 @@ pub fn set_query( query: List(#(String, String)), ) -> Request(body) { let pair = fn(t: #(String, String)) { - string_builder.from_strings([ - uri.percent_encode(t.0), - "=", - uri.percent_encode(t.1), - ]) + uri.percent_encode(t.0) <> "=" <> uri.percent_encode(t.1) } let query = query |> list.map(pair) - |> list.intersperse(string_builder.from_string("&")) - |> string_builder.concat - |> string_builder.to_string + |> list.intersperse("&") + |> string.concat |> option.Some Request(..req, query: query) }