From 2f45311e8eedd1ff1d40893476a4ca711fa4f3fc Mon Sep 17 00:00:00 2001 From: Peter Saxton Date: Fri, 20 Dec 2024 13:36:57 +0100 Subject: [PATCH] replace use of string_builder --- manifest.toml | 6 +++--- src/gleam_community/codec.gleam | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/manifest.toml b/manifest.toml index f178c00..bf12adb 100644 --- a/manifest.toml +++ b/manifest.toml @@ -2,9 +2,9 @@ # You typically do not need to edit this file packages = [ - { name = "gleam_json", version = "2.0.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_json", source = "hex", outer_checksum = "CB10B0E7BF44282FB25162F1A24C1A025F6B93E777CCF238C4017E4EEF2CDE97" }, - { name = "gleam_stdlib", version = "0.35.1", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "5443EEB74708454B65650FEBBB1EF5175057D1DEC62AEA9D7C6D96F41DA79152" }, - { name = "gleeunit", version = "1.0.2", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "D364C87AFEB26BDB4FB8A5ABDE67D635DC9FA52D6AB68416044C35B096C6882D" }, + { name = "gleam_json", version = "2.1.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_json", source = "hex", outer_checksum = "0A57FB5666E695FD2BEE74C0428A98B0FC11A395D2C7B4CDF5E22C5DD32C74C6" }, + { name = "gleam_stdlib", version = "0.49.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "A7DB09F15738198A87255425FBCE049B4B84C77CC522786DC923DABA73911F13" }, + { name = "gleeunit", version = "1.2.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "F7A7228925D3EE7D0813C922E062BFD6D7E9310F0BEE585D3A42F3307E3CFD13" }, ] [requirements] diff --git a/src/gleam_community/codec.gleam b/src/gleam_community/codec.gleam index 87b67d3..df40561 100644 --- a/src/gleam_community/codec.gleam +++ b/src/gleam_community/codec.gleam @@ -1,17 +1,17 @@ // IMPORTS --------------------------------------------------------------------- +import gleam/dict.{type Dict} import gleam/dynamic.{ type DecodeError as DynamicError, type Dynamic, DecodeError as DynamicError, } import gleam/function +import gleam/int import gleam/json.{type DecodeError as JsonError, type Json} import gleam/list -import gleam/dict.{type Dict} import gleam/option.{type Option} import gleam/pair import gleam/result -import gleam/string_builder.{type StringBuilder} -import gleam/int +import gleam/string_tree.{type StringTree} // TYPES ----------------------------------------------------------------------- @@ -567,7 +567,7 @@ pub fn encode_string(value: a, codec: Codec(a)) -> String { /// /// -pub fn encode_string_custom_from(value: a, codec: Codec(a)) -> StringBuilder { +pub fn encode_string_custom_from(value: a, codec: Codec(a)) -> StringTree { codec.encode(value) |> json.to_string_builder }