use std::format instead of fmt::format
The std::format is sufficient for the uses in this repository except
for in one file (override_fan_target.cpp, since P2286 isn't supported
by GCC yet). Switch to std::format whenever possible.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Ib2576fb530a4d7ce238e1b0bd95b40b476ec2107
diff --git a/sdbusplus.hpp b/sdbusplus.hpp
index a5fae30..9627e40 100644
--- a/sdbusplus.hpp
+++ b/sdbusplus.hpp
@@ -1,7 +1,5 @@
#pragma once
-#include <fmt/format.h>
-
#include <phosphor-logging/elog-errors.hpp>
#include <phosphor-logging/elog.hpp>
#include <phosphor-logging/log.hpp>
@@ -10,6 +8,8 @@
#include <sdbusplus/message.hpp>
#include <xyz/openbmc_project/Common/error.hpp>
+#include <format>
+
namespace phosphor
{
namespace fan
@@ -47,7 +47,7 @@
public:
DBusMethodError(const std::string& busName, const std::string& path,
const std::string& interface, const std::string& method) :
- DBusError(fmt::format("DBus method failed: {} {} {} {}", busName, path,
+ DBusError(std::format("DBus method failed: {} {} {} {}", busName, path,
interface, method)),
busName(busName), path(path), interface(interface), method(method)
{}
@@ -69,7 +69,7 @@
public:
DBusServiceError(const std::string& path, const std::string& interface) :
DBusError(
- fmt::format("DBus service lookup failed: {} {}", path, interface)),
+ std::format("DBus service lookup failed: {} {}", path, interface)),
path(path), interface(interface)
{}
@@ -88,7 +88,7 @@
DBusPropertyError(const std::string& msg, const std::string& busName,
const std::string& path, const std::string& interface,
const std::string& property) :
- DBusError(msg + fmt::format(": {} {} {} {}", busName, path, interface,
+ DBusError(msg + std::format(": {} {} {} {}", busName, path, interface,
property)),
busName(busName), path(path), interface(interface), property(property)
{}