From bfb7cc7514fcc9481f6284c47f81fba18ff8f679 Mon Sep 17 00:00:00 2001 From: Joel Rosdahl Date: Sun, 18 Feb 2024 09:33:36 +0100 Subject: [PATCH] refactor: Avoid raw fmt::format call in TextTable --- src/util/TextTable.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/util/TextTable.cpp b/src/util/TextTable.cpp index 58d01a63..2727d566 100644 --- a/src/util/TextTable.cpp +++ b/src/util/TextTable.cpp @@ -19,6 +19,7 @@ #include "TextTable.hpp" #include +#include #include @@ -106,8 +107,8 @@ TextTable::render() const for (size_t j = i + 1 - cell.m_colspan; j <= i; ++j) { width += column_widths[j] + (j == i ? 0 : 1); } - r += fmt::format( - (cell.m_right_align ? "{:>{}}" : "{:<{}}"), cell.m_text, width); + r += cell.m_right_align ? FMT("{:>{}}", cell.m_text, width) + : FMT("{:<{}}", cell.m_text, width); } result.append(r, 0, r.find_last_not_of(' ') + 1); result += '\n'; -- 2.47.2