From 809786d5476b9a77064c9b78c3a9a64905b67cd5 Mon Sep 17 00:00:00 2001 From: Vladislav Nepogodin Date: Sat, 13 Jul 2024 03:37:41 +0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20gucc:=20accept=20char=20as=20del?= =?UTF-8?q?im=20in=20utils::join=20instead=20of=20string=5Fview?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gucc/include/gucc/string_utils.hpp | 2 +- gucc/src/string_utils.cpp | 2 +- gucc/src/user.cpp | 2 +- src/utils.cpp | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gucc/include/gucc/string_utils.hpp b/gucc/include/gucc/string_utils.hpp index 7a68166..d063f66 100644 --- a/gucc/include/gucc/string_utils.hpp +++ b/gucc/include/gucc/string_utils.hpp @@ -35,7 +35,7 @@ auto make_multiline(const std::vector& multiline, bool reverse = fa /// @param lines The lines to join. /// @param delim The delimiter to join the lines. /// @return The joined lines as a single string. -auto join(const std::vector& lines, std::string_view delim = "\n") noexcept -> std::string; +auto join(const std::vector& lines, char delim = '\n') noexcept -> std::string; /// @brief Make a split view from a string into multiple lines based on a delimiter. /// @param str The string to split. diff --git a/gucc/src/string_utils.cpp b/gucc/src/string_utils.cpp index d8b71f2..0f7b339 100644 --- a/gucc/src/string_utils.cpp +++ b/gucc/src/string_utils.cpp @@ -35,7 +35,7 @@ auto make_multiline(const std::vector& multiline, bool reverse, std return res; } -auto join(const std::vector& lines, std::string_view delim) noexcept -> std::string { +auto join(const std::vector& lines, char delim) noexcept -> std::string { return lines | std::ranges::views::join_with(delim) | std::ranges::to(); } diff --git a/gucc/src/user.cpp b/gucc/src/user.cpp index 762c4d0..c3a525a 100644 --- a/gucc/src/user.cpp +++ b/gucc/src/user.cpp @@ -85,7 +85,7 @@ auto create_new_user(const user::UserInfo& user_info, const std::vector