Skip to content

Commit 9a5b2ee

Browse files
committed
Swift: update fmt
1 parent e850a8a commit 9a5b2ee

File tree

2 files changed

+3
-16
lines changed

2 files changed

+3
-16
lines changed

MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ bazel_dep(name = "rules_shell", version = "0.5.0")
2323
bazel_dep(name = "bazel_skylib", version = "1.8.1")
2424
bazel_dep(name = "abseil-cpp", version = "20240116.1", repo_name = "absl")
2525
bazel_dep(name = "nlohmann_json", version = "3.11.3", repo_name = "json")
26-
bazel_dep(name = "fmt", version = "10.0.0")
26+
bazel_dep(name = "fmt", version = "12.1.0")
2727
bazel_dep(name = "rules_kotlin", version = "2.1.3-codeql.1")
2828
bazel_dep(name = "gazelle", version = "0.40.0")
2929
bazel_dep(name = "rules_dotnet", version = "0.19.2-codeql.1")

swift/logging/Formatters.h

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,7 @@
11
#pragma once
22

3-
// Provides formatters for standard library types to be used with fmtlib.
4-
// TODO: Patch fmtlib to support using `fmt/std.h` without RTTI
5-
// (https://github.com/fmtlib/fmt/issues/3170).
6-
3+
#define FMT_USE_RTTI 0
74
#include <filesystem>
85
#include <fmt/format.h>
6+
#include <fmt/std.h>
97
#include <string_view>
10-
11-
namespace fmt {
12-
FMT_FORMAT_AS(std::filesystem::path, std::string);
13-
}
14-
15-
template <>
16-
struct fmt::formatter<std::error_code> : fmt::formatter<std::string> {
17-
auto format(const std::error_code& e, format_context& ctx) const {
18-
return fmt::formatter<std::string>::format(e.message(), ctx);
19-
}
20-
};

0 commit comments

Comments
 (0)