Make code format the same
The only difference between a clang-format-11 formatter and a
clang-format-12 formatter seems to be this line, which seems to confuse
people. https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/46932
already got pushed trying to "fix" this, only to be rejected by CI.
It appears that the extra parens on the method name seems to confuse
clang-format, which makes little sense. This is code we inherited
from nlohmann and changed to support the html formatter, so while
nlohmann might have had good reasons for it (weird compiler support
maybe) we don't need it, so this patchset removes the parens and
reformats.
Tested:
Code compiles. No functional changes.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ide31e0be057d4b97da69203890ca6720e79887e5
diff --git a/include/json_html_serializer.hpp b/include/json_html_serializer.hpp
index 2382f29..be9efc4 100644
--- a/include/json_html_serializer.hpp
+++ b/include/json_html_serializer.hpp
@@ -397,9 +397,8 @@
static constexpr auto d = std::numeric_limits<double>::max_digits10;
// the actual conversion
- std::ptrdiff_t len =
- (std::snprintf)(numberbuffer.data(), numberbuffer.size(), "%.*g", d,
- number);
+ std::ptrdiff_t len = std::snprintf(numberbuffer.data(), numberbuffer.size(),
+ "%.*g", d, number);
// negative value indicates an error
if (len <= 0)