treewide: Convert most fmt::format -> std::format
Change-Id: I3c9ac1eed1c86c6cd9f7fd3a1ba356734e79f937
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/src/netlink.cpp b/src/netlink.cpp
index 69ea5c6..eccf039 100644
--- a/src/netlink.cpp
+++ b/src/netlink.cpp
@@ -1,6 +1,5 @@
#include "netlink.hpp"
-#include <fmt/format.h>
#include <linux/netlink.h>
#include <linux/rtnetlink.h>
@@ -9,6 +8,7 @@
#include <stdplus/raw.hpp>
#include <array>
+#include <format>
#include <stdexcept>
#include <system_error>
@@ -30,13 +30,13 @@
if (hdr.nlmsg_len < sizeof(hdr))
{
throw std::runtime_error(
- fmt::format("nlmsg length shorter than header: {} < {}",
+ std::format("nlmsg length shorter than header: {} < {}",
hdr.nlmsg_len, sizeof(hdr)));
}
if (msgs.size() < hdr.nlmsg_len)
{
throw std::runtime_error(
- fmt::format("not enough message for nlmsg: {} < {}", msgs.size(),
+ std::format("not enough message for nlmsg: {} < {}", msgs.size(),
hdr.nlmsg_len));
}
auto msg = msgs.substr(NLMSG_HDRLEN, hdr.nlmsg_len - NLMSG_HDRLEN);
@@ -185,13 +185,13 @@
const auto& hdr = stdplus::raw::refFrom<rtattr, Aligned>(data);
if (hdr.rta_len < RTA_LENGTH(0))
{
- throw std::runtime_error(fmt::format(
+ throw std::runtime_error(std::format(
"rtattr shorter than header: {} < {}", hdr.rta_len, RTA_LENGTH(0)));
}
if (data.size() < hdr.rta_len)
{
throw std::runtime_error(
- fmt::format("not enough message for rtattr: {} < {}", data.size(),
+ std::format("not enough message for rtattr: {} < {}", data.size(),
hdr.rta_len));
}
auto attr = data.substr(RTA_LENGTH(0), hdr.rta_len - RTA_LENGTH(0));