From a406d8c5beb9c7cd59be32f4e94a7d1295d59172 Mon Sep 17 00:00:00 2001 From: Tom Huntington <55266932+tom-huntington@users.noreply.github.com> Date: Fri, 24 Feb 2023 21:06:33 +1300 Subject: [PATCH] not -> ! --- include/fmt/std.h | 2 +- test/std-test.cc | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/include/fmt/std.h b/include/fmt/std.h index 544ec541..4b22eda1 100644 --- a/include/fmt/std.h +++ b/include/fmt/std.h @@ -125,7 +125,7 @@ struct formatter, Char, template auto format(std::optional const& opt, FormatContext& ctx) const -> decltype(ctx.out()) { - if (not opt) return detail::write(ctx.out(), none); + if (!opt) return detail::write(ctx.out(), none); auto out = ctx.out(); out = detail::write(out, optional); diff --git a/test/std-test.cc b/test/std-test.cc index a5a4dcc6..f30c514b 100644 --- a/test/std-test.cc +++ b/test/std-test.cc @@ -59,8 +59,7 @@ TEST(std_test, optional) { std::optional{3}}), "[optional(1), optional(2), optional(3)]"); EXPECT_EQ( - fmt::format("{}", std::optional>{std::optional{ - "nested"}}), + fmt::format("{}", std::optional>{{"nested"}}), "optional(optional(\"nested\"))"); EXPECT_EQ( fmt::format("{:<{}}", std::optional{std::string{"left aligned"}}, 30),