From f45e9ba23410d67e5d82276fb19f7f049f0d9244 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 8 Jan 2025 16:39:50 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- include/mbgl/util/string.hpp | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/include/mbgl/util/string.hpp b/include/mbgl/util/string.hpp index aadd1dcc76d..92773850958 100644 --- a/include/mbgl/util/string.hpp +++ b/include/mbgl/util/string.hpp @@ -100,18 +100,13 @@ inline float stof(const std::string &str) { // Note: asked author to clarify license template -struct CompileTimeString -{ +struct CompileTimeString { constexpr CompileTimeString() noexcept = default; - constexpr CompileTimeString(const char(&literal)[ArraySize]) noexcept - { - std::ranges::copy(literal, data); - } + constexpr CompileTimeString(const char (&literal)[ArraySize]) noexcept { std::ranges::copy(literal, data); } template - constexpr auto operator+(const CompileTimeString& other) const noexcept - { + constexpr auto operator+(const CompileTimeString &other) const noexcept { CompileTimeString result; std::ranges::copy(data, result.data); std::ranges::copy(other.data, result.data + ArraySize - 1); @@ -131,19 +126,16 @@ struct CompileTimeString constexpr auto crend() const noexcept { return std::crend(data); } template - constexpr bool operator==(const CompileTimeString& other) const - { + constexpr bool operator==(const CompileTimeString &other) const { return as_string_view() == other.as_string_view(); } - constexpr bool starts_with(std::string_view sv) const noexcept { return as_string_view().starts_with(sv); } constexpr bool starts_with(char ch) const noexcept { return as_string_view().starts_with(ch); } - constexpr bool starts_with(const char* s) const { return as_string_view().starts_with(s); } + constexpr bool starts_with(const char *s) const { return as_string_view().starts_with(s); } template - constexpr bool starts_with(const CompileTimeString& other) const - { + constexpr bool starts_with(const CompileTimeString &other) const { return starts_with(other.as_string_view()); } @@ -158,9 +150,8 @@ struct CompileTimeString char data[ArraySize]; }; -template -constexpr auto operator""_cts() -{ +template +constexpr auto operator""_cts() { return Str; }