From 7198db758d41d39e911fbd4523a15a15e20812b2 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 16 Apr 2024 10:59:45 +0200 Subject: [PATCH] lib/fmt/PathFormatter: eliminate AllocatedPath specialization with std::convertible_to --- src/lib/fmt/PathFormatter.hxx | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/lib/fmt/PathFormatter.hxx b/src/lib/fmt/PathFormatter.hxx index 417d4512d..e5ae89dec 100644 --- a/src/lib/fmt/PathFormatter.hxx +++ b/src/lib/fmt/PathFormatter.hxx @@ -1,24 +1,19 @@ // SPDX-License-Identifier: GPL-2.0-or-later // Copyright The Music Player Daemon Project -#ifndef PATH_FORMATTER_HXX -#define PATH_FORMATTER_HXX +#pragma once #include "fs/Path.hxx" -#include "fs/AllocatedPath.hxx" #include -template<> -struct fmt::formatter : formatter +#include + +template T> +struct fmt::formatter : formatter { template auto format(Path path, FormatContext &ctx) { return formatter::format(path.ToUTF8(), ctx); } }; - -template<> -struct fmt::formatter : formatter {}; - -#endif